show post titles in a sub category
-
Hi All,
Developing locally so not able to show a link.I’ve got the following code on my page which lists all sub categories within the selected category:
[code]
<?php
# LIST ALL SUB-CATEGORIES FOR A GIVEN CATEGORY
if (is_category()) {
$this_category = get_category($cat);
if (get_category_children($this_category->cat_ID) != "") {
#echo "Subcategories
";
echo "- ";
wp_list_categories('orderby=id&show_count=0&title_li=
&use_desc_for_title=1&child_of='.$this_category->cat_ID);
echo "";
}
}
?>
[/code]
This works well. However, I’d like to show the post titles within the list sub categories. Is this possible?
So if i were in cars. It will then show sub cats, audi, bmw, citroen. And under those it will list post titles relevant to that sub category. So for BMW, it may list. Latest M3 news, latest M5 news etcTIA
-
If you are developing locally, then you are either wasting your time or you are in the wrong forum. This is for blogs hosted by WordPress.com, and you can’t use FTP, access the php, etc here.
Please read this:
https://en.forums.wordpress.com/topic/please-read-me-first-before-posting?replies=1
-
-
- The topic ‘show post titles in a sub category’ is closed to new replies.