How to perform str_replace on the results of wp_list_pages

Change your $child in your code to $InnerPages, like this: $InnerPages = wp_list_pages(‘child_of=”.($post->post_parent != false ? $post->post_parent : $post->ID).”&title_li=&echo=0’); $InnerPages = str_replace(‘<ul class=”children”>’, ‘<ul class=”children”><li>Overview</li>’, $InnerPages); echo $InnerPages; You were saving your change in $child but then displaying $InnerPages which was unchanged. Additionally the class is children and not child and must match exactly to … Read more

How can I add HTML classes for current taxonomy/term hierarchy into my pages to simplify styles?

Note – I may need to edit this after you give me some feedback. The trick here is to use either the body_class or post_class filters. Your theme (should) use the body_class function to inject a number of classes into your HTML tag and the complementary post_class function to do the same for whichever tag … Read more

Help with Multi Level Category Archive Page

I have been successful in achieving exactly what I was looking for. For me to solve this dilemma I used the following code in the archive-treatments template using the following code: <?php $args = array( ‘taxonomy’ => ‘treatment-categories’ ); $categories = wp_list_categories( $args); ?>

Creating Slider in wordpress theme with custom post

Perhaps in your post loop you would need to add a condition that checks for post type, using the get_post_type() function. So something like this: <?php if(have_posts()) : ?> <?php while(have_posts()) : the_post(); ?> <?php if(get_post_type(get_the_ID()) === ‘your custom post type’) : ?> //Your slider code with current post data <?php endif; ?> <?php endwhile; … Read more