Change posts list Breadcrumb

It seems that you have a misunderstanding about a static front page and a blogpage and the returned result from the conditional tags. Here is a short explanation STATIC FRONT PAGE The general misconception is that your static front page is your home page, which it is not. The static front page is just a … Read more

How to display parent category name and link for custom breadcrumb

You can use get_ancestors: <?php if ( $term_ids = get_ancestors( get_queried_object_id(), ‘category’, ‘taxonomy’ ) ) { $crumbs = []; foreach ( $term_ids as $term_id ) { $term = get_term( $term_id, ‘category’ ); if ( $term && ! is_wp_error( $term ) ) { $crumbs[] = sprintf( ‘<a href=”https://wordpress.stackexchange.com/questions/225528/%s”>%s</a>’, esc_url( get_term_link( $term ) ), esc_html( $term->name ) … Read more

Slugs as breadcrumbs for Pages

Ok, problem solved. I´ll add the script below. Hope it´s useful for someone. if ( is_page() ) { $post = $wp_query->get_queried_object(); if ( $post->post_parent == 0 ){ echo “<li> &raquo; “.ucwords(str_replace(“-“, ” “, $post->post_name)).”</li>”; } else { $title = the_title(”,”, FALSE); $ancestors = array_reverse( get_post_ancestors( $post->ID ) ); array_push($ancestors, $post->ID); foreach ( $ancestors as $ancestor … Read more

Show current navigation path from menu

The best way would be to use wp_nav_menu with a custom walker. Prerequisites: Registered theme location Menu saved to that theme location Useage Wherever you want the breadcrumbs (for theme location ‘primary’): <?php wp_nav_menu( array( ‘container’ => ‘none’, ‘theme_location’ => ‘primary’, ‘walker’=> new SH_BreadCrumbWalker, ‘items_wrap’ => ‘<div id=”breadcrumb-%1$s” class=”%2$s”>%3$s</div>’ ) ); ?> The custom walker … Read more

Making breadcrumb with wp_nav_menu

I couldn’t believe there is not a single FREE plugin available that does this. So I wrote my own function. Here you go. Just copy this to your functions.php: function my_breadcrumb($theme_location = ‘main’, $separator=” &gt; “) { $theme_locations = get_nav_menu_locations(); if( ! isset( $theme_locations[ $theme_location ] ) ) { return ”; } $items = wp_get_nav_menu_items( … Read more

How to add a page to the Yoast breadcrumbs

Here’s the general principle of what you need to do: Hook into the wpseo_breadcrumb_links or wp_seo_get_bc_ancestors API filters. Add your Blog into the WordPress SEO Breadcrumb $links array, using array_splice. Place this in your theme’s functions.php: /** * Conditionally Override Yoast SEO Breadcrumb Trail * http://plugins.svn.wordpress.org/wordpress-seo/trunk/frontend/class-breadcrumbs.php * ———————————————————————————– */ add_filter( ‘wpseo_breadcrumb_links’, ‘wpse_100012_override_yoast_breadcrumb_trail’ ); function wpse_100012_override_yoast_breadcrumb_trail( … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)