display post titles only for descendants of a certain category
-
hi there – please excuse me if this is a silly question. I was asked to look at a portfolio theme, and the client would like the titles of the portfolio items to display only for those items which are descendants of the category ‘videos’. I am just learning PHP, so I’m not quite sure what to add to the existing code that builds the portfolio page.
(The portfolio theme has an admin panel where you can set the post titles to display for all or none portfolio items, hence $options below.)
Here is the code for that:
<?php //unless disabled show portfolio item title if ($options['disable_portfolio_title'] == false ) { ?> <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4> <?php } ?>
I am hoping that I can add something to that if statement that will filter the results, and only show the titles for the posts in the video category and its descendants. Any help would be greatly appreciated. I’ve been searching through the codex but haven’t yet had any success.
Also, please let me know if you need to see more code.
Thank You.
- The topic ‘display post titles only for descendants of a certain category’ is closed to new replies.