how to put breadcrumb under Title [closed]
how to put breadcrumb under Title [closed]
how to put breadcrumb under Title [closed]
Stop breadcrumb function retrieving custom post type template name
You really shouldn’t be doing this. Functions belong in the functions file. Period. (Or perhaps in a separate functions file which you include in the main one) However, if you insist, you can drop functions in any template file you want, because PHP doesn’t care. Actually you will need to include it in every template … Read more
Try a breadcrumbs plugin. Breadcrumb NavXT is a popular option I believe. An alternative solution of is just printing the name of the current page. Here’s what such a function might look like in its most basic form: function wpse_87332_nav_identifier() { $page_name = get_the_title(); echo “You are here: ” . $page_name; } Note that this … Read more
Just grabbed a snippet from the get_cpt_crumb() function in the genesis breadcrumbs class file (/lib/classes/breadcrumb.php) protected function get_cpt_crumb() { $post_type = get_query_var( ‘post_type’ ); $post_type_object = get_post_type_object( $post_type ); if ( $cpt_archive_link = get_post_type_archive_link( $post_type ) ) $crumb = $this->get_breadcrumb_link( $cpt_archive_link, sprintf( __( ‘View all %s’, ‘genesis’ ), $post_type_object->labels->name ), $post_type_object->labels->name ); else $crumb = … Read more
Actually you need to hook the breadcrumbs function to any hook which fires in cart and check pages. In the below case I called the function at the_dramatist_show_breadcrumbs which I have hooked to woocommerce_before_cart for cart page and woocommerce_before_checkout_form for checkout form. So the entire code block looks like below- For minimal usage ( Only … Read more
For the button behavior, If it’s a one-off use case, you could add custom php conditional to check the referring url $_SERVER[‘HTTP_REFERER’] and current page/post ID or url. Then, either add a class to the button’s containing div wrapper in the template for hiding via css or directly output/include the button html in the template … Read more
You can make use of the get_the_categories filter to remove the parent categories from the list. the_category() uses get_the_category_list() which in turn uses get_the_category() The idea is to check the categories returned against an array of parent ids and then removing those categories from the list. You can try the following (Requires PHP 5.3+) add_filter( … Read more
Based on the code your used my guess is it would be as simple as adding a unset($bcarray[0]); to their code on line 15. Here is the code in it’s entirety: function write_breadcrumb() { $pid = $post->ID; $trail = “<a href=”https://wordpress.stackexchange.com/”>Home</a>”; if (is_front_page()) : // do nothing elseif (is_page()) : $bcarray = array(); $pdata = … Read more
The easiest way you can remember which taxonomy the user arrived through to a certain post is by storing it in a cookie. This is essentially what the Smarter Navigation plugin does, except it can handle all archives, not just taxonomy archives.