FionaGilbert
Member
Posted 3 years ago #
Morning all,
I am having a little problem showing child post listings.
When I select - for example - the link 'bands' from parent link 'entertainment' it tells me 'sorry no posts'. Why is this?
This is my code: ' <?php $a = 1; $query1 = new WP_Query();$query1->query('posts_per_page=5&cat=' . get_query_var('cat')); ?>
<?php while ($query1->have_posts()) : $query1->the_post(); ?>'
What might I be doing wrong?
Thanks for any assistance.
What is a child post? A post belonging to a child category? Or a child page?
FionaGilbert
Member
Posted 3 years ago #
Sorry, a child category.
Thank you
You shouldn't need any special query to do that.
Switch to the WordPress Default theme and then click on a child category link. Don't you see the posts.
Related:
Category Templates
Template Hierarchy
FionaGilbert
Member
Posted 3 years ago #
Hmmmmm, no I don't. Checkout my partner's server:
Update your permalinks by visiting Administration > Settings > Permalinks and clicking on Save Changes.
FionaGilbert
Member
Posted 3 years ago #
Hmmmmm, still no joy. I am using this permalink structure: /%category%/%postname%/
FionaGilbert
Member
Posted 3 years ago #
Found the problem. The plugin: Top Level Categories - http://fortes.com/projects/wordpress/top-level-cats/
Removes the prefix from the URL for a category. For instance, if your old category link was /category/catname it will now be /catname
Shame I can't use this but I understand why.
Thanks for your help.
FionaGilbert
Member
Posted 3 years ago #