Codex Function Problems When There is an Apostrophe in the Category Name
You can use this. May it will help you. ent2ncr Converts named entities into numbered entities.
You can use this. May it will help you. ent2ncr Converts named entities into numbered entities.
I managed to fix this by: <?php function the_breadcrumb() { global $post; $post_type = $post->post_type; echo ‘<ul id=”breadcrumbs”>’; if(get_post_type() == ‘forum’ OR get_post_type() == ‘topic’ OR get_post_type() == ‘reply’) { echo ‘<li><a href=”‘; echo get_option(‘home’); echo ‘”>’; echo ‘<i class=”ts-awesome-home” style=”font-size:14px;letter-spacing: 2px;”></i> Home’; echo ‘</a></li><li class=”separator”> / </li>’; echo ‘<a href=”https://link”>Forum</a>’; echo ‘ / ‘; … Read more
I simply had to remove ‘is_page() && ‘ in both the if and the elseif function the_ajax_breadcrumb($post_id) { ob_start(); $args = array(‘page_id’ => $post_id); $the_query = new WP_Query($args); $currentBefore=”<li><a>”; $currentAfter=”</a></li>”; while ( $the_query->have_posts() ) { $the_query->the_post(); if ( !is_home() && !is_front_page() || is_paged() ) { echo ‘<nav class=”breadcrumb”><ul>’; if ( !$the_query->post->post_parent ) { echo $currentBefore; … Read more
You can use wp_get_post_parent_id to return just the parent ID of the page in question. Then you can use get_the_title and get_permalink with that parent ID to build a back button to the parent page; <?php if( $parent = wp_get_post_parent_id( get_the_ID() ) ): ?> <a href=”https://wordpress.stackexchange.com/questions/167269/<?php echo get_permalink($parent); ?>”><?php echo get_the_title($parent); ?></a> <?php endif; ?> … Read more
To specifically target a page and show its children/siblings you can use wp_list_pages(); eg. wp_list_pages(array( ‘child_of’ => “page parent ID”, ‘depth’ => 2 ));
I got it working as @Pieter suggested to check if page has parent or not. Got the help from here Breadcrumb how i can display page title with parent > child title with permalink ? any Idea
I always like the non-plugin solution, even if it’s a hard one. To create a breadcrumb, you will need to functions. One, will create a chain of items ( such as categories ) for you. This will be used to form the breadcrumb later: function get_category_parents( $id, $link = false, $separator=”https://wordpress.stackexchange.com/”, $nicename = false, $visited … Read more
For option a, see the Breadcrumb NavXT FAQ. For option b, since there isn’t an all encompassing “current item breadcrumb template”, you have two options: Since all the unlinked breadcrumb templates are used for the current item, just replace the %title% and %htitle% tags with ‘You are here’. Write a filter for the bcn_breadcrumb_title hook, … Read more
Breadcrumb that shows multiple custom taxonomies
Solved I’ve solved it by myself. The WordPress function get_the_term_list() returns the terms of the post, but unfortunately they are in the reversed hierarchical order, so I had to turn them around. $id = get_the_ID(); $terms = get_the_term_list( $id , $taxonomy , ” , $randomstring ); $terms_array = explode( $randomstring , $terms ); $terms_string = … Read more