Wednesday, June 12, 2013

Wordpress Codex

First off, let me designate a distinction when working with Wordpress.com or Wordpress.org. Wordpress.com is hosted by Wordpress. Wordpress.org contains files and instructions concerning how to host a site yourself or through an online service(given they provide ftp access and database access) and use Wordpress as a CMS(Content Management System).

The Wordpress Codex is amazing and exists primarily to help self-hosted operations (hence it is hosted at Wordpress.org). http://codex.wordpress.org/Template_Hierarchy is a simple page which shows which php file will be used to display any given page. Simply put, if a "front-page.php exists in your theme's directory (you must choose a theme to use in the wp-admin panel, if that theme is "Twenty Twelve" then the folder we are talking about is www.yoursite.com/wp-content/themes/twentytwelve) then Wordpress will deliver it's content to the browser. The functions "get_header()" and "get_footer()" usually exist in these pages and will include the content from "header.php" and "footer.php" respectively. If front-page.php does not exist, wordpress will then deliver other content based on options that are set in Settings->Reading (settings is on the left side of the wp-admin page). If the "Front Page Displays" option is set to "Your Latest Posts" then it will display content from "home.php" if "A static page" is selected,  then other conditions are checked and it will likely display "page.php" unless otherwise stated (e.g. "Pages->add new" will let you create a page to select here. While creating a page you are given the option to select a template if more than the default template exist, doing so will change this.)

Don't be afraid to use the Codex.

No comments:

Post a Comment