A member in my last topic refereed me to this template to get me started on viewing my categories in a specific way on the index page.
I need to modify the code in the template so that I can provide alternate div wrappers around the post divs, unfortunately, this needs a little more php handling than I can manage.
I figure an if statement would work, IF categoryid=1 then use this, if its not, use default. But I have no idea how to nest it or how to target the category I want it to check for, can anyone with php expertise help me out?
If you can help me fix this, it’ll make my day, hey I’ll even help you with graphics to make this worthwhile.
The Full Template Code.
The snippet that needs editing:
<?php /* post loop for each category listing */ foreach($posts as $post) : the_post(); $category = get_the_category(); // if post is in correct category if($current_cat == $category->cat_ID) : ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="entry"><?php the_content(); ?></div> </div> <?php endif; // end 'if post in correct category' endforeach; // end post loop rewind_posts(); // reset loop for next category endforeach; // end 'display by category' loop ?>
- The topic ‘Modifying a Template, PHP help?’ is closed to new replies.