replace integers with variables
-
hacking around some wordpress default theme.
what i am trying to do is create a custom page template that when applied shows posts in that category using post meta. this is working well.
however, i’d also like the menu to display only the parent category and children of that the category.
i’m trying to replace
child_of=3tochild_of=$categori_idhere is the code
<div id="sidebar" class="internet_bar"> <ul> <?php if (is_page() ) { $categorize = get_post_meta($posts[0]->ID, 'category', true); } if ($categorize) { $categori = get_the_category(); $categori_id = get_cat_ID($categorize); echo "<li>" . $categorize ."</li>"; $categlories= get_categories('child_of=3'); foreach ($categlories as $categlory) { $option = '<li>'.$categlory->category_nicename.'</li>'; echo $option; } } ?> </ul> </div>example page of this code here – http://bedepressed.org/criticalgeography/online
online only is parent, other two categories are children
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘replace integers with variables’ is closed to new replies.