Need help to Display my categories
-
Hi Guys,
I need a help to Display my categories properly.
for example, if i want to add Video, Music, News, Tech…categories to my theme, where do I have to modify code.Here is the instruction that template author provided, hoever I am not sure where do I have to sinsert new categories.
please help:
1. To show the category bar in the front page properly, you have to put the correct category IDs to this line in the index.php file:
<?php $display_categories = array(5,6,7,8,11); $i = 1;
foreach ($display_categories as $category) { ?>
Notice that 5, 6, 7, 8, and 11 are the IDs of the category to be shown in the category bar.
2. To show the post list in the front page properly, you have to put the correct excluded category IDs to this line in the index.php file:
<?php $page = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
query_posts(“cat=-9,-15&paged=$page&posts_per_page=2”); ?>
Notice that 9 and 15 are the IDs for the category: Headline and Featured. That will make no duplication shown in the front page. posts_per_page=2 means there are 2 posts listed per page. The navigation links are shown after the last listed post. You can change that to Lester-Chan’s WP-Pagenavi if you like.
- The topic ‘Need help to Display my categories’ is closed to new replies.