Wordpress: sort into sub-pages, then sort by tag
- by redconservatory
I have a wordpress page with two or three sub-pages ("TV", "WEB", "WATCH") and I would like to have the sub-page links on the page itself.
So, far, I can pull the sub-pages the following way:
<?php
$children = wp_list_pages('title_li&child_of='.$post->ID.'depth=1&echo=0');
if ($children) { ?>
<ul>
<?php echo $children; ?>
</ul>
<?php } ?>
However, is there a way to loop through $children so I can pull each link by it's tag?
i.e. using has_tag('tv'), has_tag('web')
Between the wordpress conditional tags and php, I am not sure how to write this.