Display child-page links in sidebar on both Parent Pages AND Child Pages

The following fixed the issue for me: <?php switch ($isBlogsPostPage){ case true: $parentID=get_correct_id($post, $isBlogsPostPage); break; default: $parentID=get_correct_id($post); } $args = array( ‘post_type’ => ‘page’, ‘posts_per_page’ => 10, ‘post_parent’ => $parentID, ‘orderby’ => ‘menu_order’ ); $parent = new WP_Query( $args ); if ( true ) : ?> <section class=”links border shadow”> <ul> <?php while ( $parent->have_posts() … Read more

How to add a target to a link

If you use the filter “the_content” you can use a combination of preg_… statements to loop through all links, adding target=”_blank” to those matching your specific requirements. You can add this filter to your functions.php, or to select page,post, or category templates . add_filter( ‘the_content’, ‘ex1_the_content_filter’ ); function ex1_the_content_filter($content) { // finds all links in … Read more

How do i get the link of the assigned taxonomy term?

If you want to display links to each category, separated by spaces, use get_the_term_list(): <?php echo get_the_term_list( null, ‘blog-category’, ”, ‘ ‘, ” ); ?> If you have an individual term whose link you want to get, use get_term_link(): $url = get_term_link( $term );