Pull data from WordPress - wordpress

What's the best way to pull data from Wordpress database? I think creating a plugin would be nice. Is there a tutorial out there that do the job? Or a plugin that does it? Pull content of the page via JSON/XML.
Cheers,
Mickey

Here's the link to the plugin:
http://wordpress.org/extend/plugins/json-api/

A generic easy way to export data from a mySQL database in XML format could be phpmyadmin.net

If you are looking to integrate HTML from Wordpress in a PHP-driven site, the easiest and fastest way is to include the WordPress main include, and use the native WP functions to get hold of the data.
Wordpress Codex: Integrating Wordpress with your website
Wordpress Codex: The Loop
Just one caveat from experience: Wordpress is fat. Including the wordpress header file will eat up 8-12 MB of your allocated per-script memory (usually somewhere between 16-64 MB) from the start. You may be able to steer around that, however, by loading the Wordpress data in a different script, or caching the requests (probably a good idea anyway).
WordPress also has basic built-in RSS export functionality.

Related

Building a website for a hotel - is WordPress the best idea?

I'm researching to see if building a full website for a hotel be a good idea to do on WordPress.
I read that wordpress is okay but there are better options.
I want to design and code my own front end look to the website, but have the backend on a stable platform that can take all the reservations seamlessly.
My main concern is to be able to have a backup of all the files and easily switch to another server in case something goes wrong.
I can host the website on my server or host with the service you suggest that comes with the platform all together.
Any ideas and/or suggestions are greatly appreciated!
There are other options, no doubt, but yes, it can and is really possible to build it using WordPress as CMS.
If you want to design and code your own theme, you'll need to study the WordPress Theme Structure and, since you'll build it by yourself, you'll also need to develop plugins to create custom post types (aka CPT) to make the hotel management easier on the WP back-end.
About the theme structure, files, child themes and everything, I'd recommend you to read https://codex.wordpress.org/Theme_Development
About the plugins development: https://developer.wordpress.org/plugins/
About Custom Post Types: https://developer.wordpress.org/plugins/post-types/registering-custom-post-types/
About the backup: it's super easy and you can even make a full backup using free plugins via back-end. But if the site goes down you can easily do it via FTP downloading only wp-content folder and the database. It's really simple to migrate from one WordPress to another, or from host to host.
About the hosting, you'll need to use a server if you want to build this project. There's a difference between wordpress.com and wordpress.org
The .com is simpler, you are not able to build everything you want. The .org is the open source project, which you get the files, upload to your server and connect to database (MariaDB or MySQL). Most hosts offer automatic installation for WordPress and, from there, you can change whatever you want and need.
Note: many developers create CPTs INSIDE the theme's code, but this is not recommended by WP as you can see in We recommend that you put custom post types in a plugin rather than a theme. This ensures that user content remains portable even if they change their theme.
WP is not really hard, after 1 week studying you'll see yourself getting over most difficulties. Even if it takes longer, don't give up. There's a huge community to help you with WP questions.
Hope it helps and I'm sorry my bad writing, I'm not an english native speaker.
C ya

Integrating Wordpress from one WP site into another non WP site

I am developing a mobile version of a current WP site, but this mobile version is not WP. So I need to be able to access the information in the database of the non-responsive, existing WP site in this new one. The mobile site is located in a sub-folder called mobile (somesite.com/mobile) in the root directory of the current WP site.
I've visited the WP forum and posted this same question without responses. I've also read their integration page (http://codex.wordpress.org/Integrating_WordPress_with_Your_Website) but it doesn't seem like that would work for this application, because I figure it would just cause the mobile index.php page in the /mobile folder to just revert to the main theme.
Any suggestions or advice would be much appreciated.
You should use the integration guide you posted:
define('WP_USE_THEMES', false);
This part tells wordpress not to use themes.
I think a better approach to this problem is to make the current wordpress theme responsive:
there are a number of ways to achieve this: you can add separate stylesheets for different browser sizes: http://css-tricks.com/resolution-specific-stylesheets/ or you can use css3 media queries directly in the stylesheet: https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries
You must create the new site using data from the WP site.
Ok. You will need to create your html/php files, but, using WP database.
You can just access WP database and query it... but you will have a lot of work, in some places... like, URL, you will need to transcript URLs saved on database, and, when a user click on that link, you will need treat it to find "back" what URL it means, to catch the content.
I't not a easy job.
The WP_Query (http://codex.wordpress.org/Class_Reference/WP_Query) class can easy your life.
The WP_Db (http://codex.wordpress.org/Class_Reference/wpdb) too.
Both, I think you can use without the whole WP.
But, like #Jonathan said, build a responsive template will be a best solution.

Migrating from concrete5 to wordpress

I need to convert a concrete5 site to a WordPress site.
I can't find any plugins on both sides. There might be a solution via a feed ex-/import but it does not support all the contents and images.
Is there any idea how to do this?
I don't know of any pre-packaged solution for this. If there aren't too many pages (under 50 or 100), your best bet is to do it manually -- hire a temp worker for a day if you're a developer with a non-trivial rate.
If there are hundreds or thousands of pages, though, then you'll want to come up with your own automated solution. You can get some kind of XML representation of site content I believe via the Dashboard "backup site" functionality (not the "backup database" one). Or look into the concept of "Starting Points" in Concrete5 -- there's a free addon in the marketplace that lets you export site content in another XML format.
Then look into wordpress importers, and figure out how to transform the C5 output XML into whatever format your wordpress importer requires.
Best of luck.
There's a plugin at the WordPress plugin directory for an automated migration. It supports to migrate posts, attachments (images and videos), content images and list of other things, so it might answer your request.
The quick guide to the process includes following steps -
You install the plugin on your WP website
Create the account at the service
Download the bridge folder and connect to your concrete5 website via FTP
Choose the entities you want to migrate
Try the demo migration (it migrates up to 10 posts)
If you like it you can try the full migration (it's not free)
You may refer this for more info & this service is also represented in WordPress Codex.
Hope it helps.

Converting a Joomla site to Wordpress

I have a potential client who wants to take an existing Joomla site and translate it into Wordpress. Is any sort of automagical conversion possible, or will I have to reconstruct the site in word press?
Thanks
The Wordpress Codex gives some plugins that could help you importing from Joomla to Wordpress: http://codex.wordpress.org/Importing_Content#Joomla
Best practive however, depends on what you want to import: Users, articles, whole design, etc...

How to use wordpress to make a commerical/non blog website

I have managed to setup a blog on localhost quickly using wordpress. But what is ivolved in setting up a commercial website that is not a blog?
Also, should learning to use wordpress be more diffcult than learning Asp.Net or php? I can use these languages to create a website more quickly than using wordpress it seems. I'm guessing it should be possible to create a basic php website and then somehow hook it up to the admin functionality of wordpress to publish content and update it?
Any comments and suggestions will be appreciated.
Thanks,
A few thoughts on this.
First, Wordpress is based on PHP. So if you know your way around in PHP you are able to change anything within wordpress, you can build customized plugins, templates, etc.
However, using Wordpress has nothing to do with the programming languages you know. The fact that you are struggling with it is probably more because you don't understand yet what the features of Wordpress are or what you can use them for.
You can easily use Wordpress to create a simple non-blog website by setting up pages instead of posts. So you would be using Wordpress not as a blog engine but more as what's usually called a content management system CMS (not that using it as a blog engine wouldn't make Wordpress a CMS, but I'm talking about the general usage of those wordings).
A simple Google search might help you find more information about how to accomplish it in your specific case.
Hope this helps!
You need experience with PHP, HTML and CSS to configure WordPress to run like a non-blog website. Is it easier? Maybe, you get what you want but you won't understand what is going on.
If you are creating a static web page, say like a company's web site with little to none dynamic content, use pages (not posts) and create a static front page.
If you wish to use WordPress like a generic CMS, you can either use the Pods plugin or the newly introduced custom post types and taxonomies (new in Wordpress 3.0). You still need knowledge of PHP/MySQL to configure the Wordpress Loop (which is used to display blog posts and other dynamic content) and Wordpress Theme tags (to display name of the current logged in user).
Some plugins help with customizing the site for a non-blog look. Theme My Login and Theme my Profile blends the log-in page and profile page with your theme. However, if you need to customize the appearance, or add new logic, you pretty much need programming.
In short, you would need knowledge of PHP and MySQL; CSS too, if possible. Get your hand dirty building some sites, then what Wordpress offer and does for you with its API will be more relevant.

Resources