Home tips How to display Category (Blog) in Wordpress Pages?
Monday, 22 February 2010 13:54

How to display Category (Blog) in Wordpress Pages?

In my last project i have a menu with follow pages: Home, Services, Portfolio, Contact, Blog. And in Blog Page should display Categories. How to transform WordPress Pages to the Categories?

 

Log in to the WP admin:

  1. Log in to the WP admin panel: http://YourSite.com/wp-admin/
  2. Create new Page with name Blog:
    Display Blog in Wordpress Pages
  3. Next create new Category with name Blog:
    Display Blog in Wordpress Pages
  4. Open folder: wp-content/themes/YourThemeName/ create new file with name page-blog.php.
  5. Open archive.php copy all code and past to page-blog.php.
  6. In page-blog.php find line:

<?php if (have_posts()) : ?>

 

and add this code:

 

query_posts('cat=3');

 

So we got this:

 

<?php query_posts('cat=3'); if (have_posts()) : ?>

 

Where 'cat=3' is ID of Your category. To find out what is your Blog ID. In admin panel click on Posts -> Categories -> Blog and view URL:


Display Blog in Wordpress Pages


Last Updated on Monday, 22 February 2010 14:17
 

Add comment


Security code
Refresh

© 2010. Sopov.com