Wordpress Blog Template File

Worpress Blog Template File

So go this way and create a php file called blog-template.php. Create customized blog page templates the right way To create your own design and modify the standard appearance of some page type (e.g. the Categories archives page or a blog posts page), take a look at the WordPress template tree chart.

Indicates which file is used in your topic list to show which type of posts.

If you have a ph-file in your design that fits a file in this tree, it will be used by WordPress automaticly - for example single.php for viewing a singular article. Of course, if you already have a topic with this file there, you can modify the file and it will be displayed on the page.

You would still need to make these user-defined page styles, see this Smashing Magazine review). Otherwise, if you want an administrator to select page/post template more global on the basis of certain metrics or to select customized page styles for the whole Web site on the basis of certain metrics, you must include an item in the administration panel and a customized bar in your design to show the correct page on the basis of that item.

The addition of an item to the administration area is easy with one of the many plug-ins, but can also be done manually (see for example this SitePoint article).

Creating a Custom Page Template for Blog Items

First copy your index.php file from your actual themes and change the name of the tpl_blog.php file. This is because you want to get an accurate copy of the themes features and HTML tree of your actual themes and make a page template that can finally be selected from the Page Template drop-down list.

Your new file tpl_blog.php requires you to place a specific annotation at the beginning of the file that WordPress recognizes as a user-defined template. Just put it at the top of your page and WordPress will now detect it in the Edit Page bar of the page window. Put this under the get_header() template tag:

This overwrites the actual page request with a user-defined request for 10 pages of blog post. Because we use query_posts(), we don't need to create a new user-defined WP_Query to save the user-defined request. More recent','Example' "older"

Mehr zum Thema