Cutsom Template and Parent Categories
-
Hi,
Thanks for the amazing plugin!I have two major questions.
1 – Custom template does not work.
My permalink settings:
/%category%/%postname%/My template file:
taxonomy-attachment_category.phpI can’t make the taxonomy-attachment_category.php template work. All I get is Page Not Found.
I followed Jonas Lundman post – Category template for Media Library Assistant with pagination. But I had no lucky.
Is there any trick to make it work?2 – Display categories that have images attached to post.
I would like to display inside the loop only the categories of the images attached to the post.
So far I was able to display all categories, but doesn’t exclude the ones that are not related with the post.
This is the code I’m using:<ul> <?php $args = array('taxonomy' => 'attachment_category'); ?> <?php $tax_menu_items = get_categories( $args ); foreach ( $tax_menu_items as $tax_menu_item ):?> <li> <a href="<?php echo get_term_link($tax_menu_item,$tax_menu_item->taxonomy); ?>"> <?php echo $tax_menu_item->name; ?> </a> </li> <?php endforeach; ?> </ul>
Thanks a lot,
- The topic ‘Cutsom Template and Parent Categories’ is closed to new replies.