Wordpress theme editing - mysql

Well, I am a newbie with Wordpress.
I just got a free wordpress theme. I want to edit the pages to my customization. I have a shared host which provides MySQL database.
Can I edit this wordpress theme to connect to this MySQL database and pull/push data in to my database?
Is the whole process similar to working with normal php and MySQL? Whats so much difference with the set of php's being a Wordpress theme?
Thanks

Themes are just a bunch of php files which get executed in response to some particular event (basically when a particular kind of page nees to be rendered). You can do whatever you want in them, but everything which is not meant to be "aestethic" should probably be developed in a separate set of custom plugins. You then call those from your theme.

Once you have wordpress installed with the hosting provider and the database connection between the WP installation and the hosting provider MySQL database you can edit your theme through WP itself.
Make sure you set the permissions on the WP-Templates (I think thats what it is called) folder to read/write so that wordpress can write to the template files.
View the following link for any help editing the template. How to edit a WP Template

The theme is just the interfacce of your system, on your theme you only show the data, you need to run a select for instance in the apropriate part, also for the bussines logic.
If you do in the interface, in time your system will mess up.
In the official documentation have plenty of examples and How to's,..

The short answer - there are a number of different templates for the index, search, archive, page and article views of a Wordpress theme. Some themes don't include all of them - certain templates are the default for the other optional templates. You can edit them with software like Dreamweaver or a text editor of you choice, or you can alter them from the Wordpress admin panel.
Wordpress themes are a little too complicated to explain in one simple answer, but I can recommend a tutorial. It's a little dated, but it will explain the overall ideas and it's quite good.
Here's another - I've not read it over but it looks to be well done: http://themeshaper.com/wordpress-themes-templates-tutorial/

A theme is a collection of PHP files along with related files (CSS, JavaScript, images, etc.) that control the appearance of the WordPress site. The content (posts, pages, comments, options, plugin configuration, etc.) of the blog is stored in the database. Any themes on the site are thus separate from the content.
Themes can normally be edited directly from the WordPress admin console. Click on "Appearance" and then on "Editor". You can then edit any of the current theme's files from there. Useful for tweaking things if you know what you're doing, but dangerous in some ways because there's no easy way to undo your changes. Do a backup of your theme before noodling with it.
This entry in the WordPress Codex will help:
http://codex.wordpress.org/Editing_Files

Related

Delete wordpress on website and replace it with django - Setting up website entirely with django

I own a webpage which has wordpress.org preinstalled.
I have never done anything with it, but now it's about time. As I'm learning django, I would like to build my webpage with it instead of using the preinstalled wordpress.
How do I go about it? I haven't found anything related to this topic searching the internet.
This is the webpage with preinstalled wordpress I'm talking about.
I did the same just 9 months ago ... you can literally start from scratch as you seem to not have too much on the wordpress page its not a big damage. Next steps: you can check if the theme you used is also available for html5 so it looks familiar and you need to choose a provider who hosts django unless you dont want to setup the server yourself. Any questions ... just ask.

Can a separate WordPress (same server) get posts from an existing one, but have different settings?

When developing WordPress themes for a site with a large amount of posts, how can I dynamically pull existing post data from the live version of the site onto my testing site? I already know about WordPress's export feature, but that's one-and-done, not dynamically queried.
Plan A:
Proposed Solution:
Create read-only user in live site's database
PRECAUTION: change test site's prefix from "wp_" to "test_"
Problems:
Settings (like current theme) on test site cannot be changed, thanks to read-only user
No posts found in "test_posts", even though I'd like it to search "wp_posts"
Is there an easier way or existing solution to avoid rewriting WordPress system files on the test site? I'd really rather not rewrite WordPress's database interface...
Similar: Linking themes across WP installations
just duplicate the DB, re-name and call DB in wp-config!

Migrating Widget Settings in WordPress

I've done a lot of WordPress migrations from one server to another at work and elsewhere, but one strange thing I've never been able to understand is why widget settings never get carried over.
I'll dump the MySQL database, find/replace localhost with the live domain, SSH the database up to the live server, and then ftp the whole WP installation (core and theme, from my local machine), and still the widget settings are wiped out. And sometimes this is also the case with values saved in theme options pages I make in the Dashboard.
What am I missing?
Wordpress stores widget options - and some plugins and themes also store their options - as serialized data, and so you have to be more careful than a full find/replace of the URLs.
Much more comprehensive answer and some other ways to do move databases and retain serialized data: https://wordpress.stackexchange.com/questions/9076/why-is-my-database-import-losing-text-widget-data
To move a wordpress site and to reconvert all serialized data I used this script.
the using is very simple, download the script, change the credential variable to the database inside the php script and run it.
link to download the script:
http://davidcoveney.com/575/php-serialization-fix-for-wordpress-migrations/
work fine.
Don't do it manually!
Dont edit database manually when migrating between different domains!
Use small scripts, like this:
Wordpress-Migrator.php (read description too.)
because SERIALIZED arrays needs to be modified specifically too!!!

moving wordpress mu to another domain - sql statements

I'm assuming these instructions are for "normal" wordpress... will this work with wpmu or do i need to modify this? Is there anything i should watch for?
http://www.mydigitallife.info/2007/10/01/how-to-move-wordpress-blog-to-new-domain-or-location/
See Moving WordPress « WordPress Codex and WordPress Serialized PHP Search Replace Tool
The biggest issue you face is changing URLs in the database; and you will need to change these URLs in each of the individual databases that Multisite installs uses. Check out the find/replace tool linked above; it correctly deserializes/serializes data in the database. If you change URLs in a text database dump, or with SQL queries as in the link you listed in your question, you risk breaking data, such as theme options and widget settings.
1/09/2016 Note: WordPress MU doesn't exist anymore. MU was rolled into WordPress core in version 3.0.

Wordpress post sync / publish to production

I'm using wordpress as a simple backend CMS for a flash site. Posts are queried and displayed in list format on the frontend. I want to be able to make post edits or add new posts on my staging server, and have a quick and easy way to publish changes to production without having to do a full mysql db dump / import. I've looked around for plugins or solutions but haven't found any. Seems like wordpress needs a "publish to production" option.
The intended workflow is that users can create or edit content as much as they want, then an editor will go through it and approve content. Once everything looks good on staging, we publish to production. Any ideas?
Some of this thread at Wordpress might be relevant for you as it concerns moving from staging to production and the use of relative and absolute paths, etc.
WordPress does have a preview button that should allow you to see the WP content without actually publishing. If you must see it in the flash site, I think your best bet will be to setup your flash site with XML-PRC.