I'm developing a simple plug in and I need to filter single_cat_title in category page adding some html in every category page. Just doing this: function subtitleCategory ($title) { return $title."</div></div></div><div class=\"container_24\"><h2 id=\"category-subtitle\">TEST1</h2></div>"; } add_filter('single_cat_title', 'subtitleCategory'); I get what I need. But I noticed that this filter also apply to the breadcrumbs (there is a call in breadcrumbs.php) and this means twice in the same page (not what I need). Do you know if there is a condition that can …
custom bread crumb not working with multiple categories assigned to a single product, we do not have the categories page, so don't want to show categories in the URL, but need to show the categories navigation on the breadcrumb . <?php function bootstrap_breadcrumb($custom_home_icon = false, $custom_post_types = false) { wp_reset_query(); global $post; $is_custom_post = $custom_post_types ? is_singular($custom_post_types) : false; $post_type = get_post_type(get_the_ID()); if (!is_front_page() && !is_home()) { echo '<ol class="d-flex breadcrumb-wrapper">'; echo '<li><a href="'; echo get_option('home'); echo '">'; if ($custom_home_icon) …
I need a custom breadcrumb for my account page.Can we do it via functions.php ? add_filter('theme_breadcrumb_args_filter', 'customize_separator_breadcrumbs'); function customize_separator_breadcrumbs($args) { $args['sep'] = ' >> '; return $args; }
I would like to display the other paths/pages which are before the current site, plus the current site as you can see here. I searched the web and I couldn't found something. It may also be that I do not know what I should look for.
I have a post with two/three categories associated to it. Category 1 (1) and Category 2 (2). Number two also has a sub category (2.1) I select the sub category (2.1) to be the primary category. However, in the bread crumbs the category 1 always shows. I don't understand how I can make the category sting 2 to show in the bread crumbs instead. I use the Yoast plugin to make the (2.1 category to be my primary category). Should't …
I am using the Custom Post Type UI plugin to add custom post types to our website. We now created a CPT called IPDC. For this custom post type, we would like to have the option to link every IPDC page to a parent page, the parent page being a default Wordpress page. I guess I could do this by adding a custom field, but how do I manage the slug and breadcrumb in that case? For example. The IPDC …
Iam new to WooCommerce theming and get stuck with category display page here is the code i have: /** * Change several of the breadcrumb defaults */ add_filter('woocommerce_breadcrumb_defaults', 'jk_woocommerce_breadcrumbs'); function jk_woocommerce_breadcrumbs() { if (is_product_category()) { global $wp_query; // get the query object $cat = $wp_query->get_queried_object(); // get the thumbnail id using the queried category term_id $thumbnail_id = get_term_meta($cat->term_id, 'banner', true); // get the image URL $image = wp_get_attachment_url($thumbnail_id); // print the IMG HTML echo ""; return array( 'delimiter' => ' …
I want to obtain a path of all parents for current page. Something similar to breadcrub but used only for pages listed in menu. For example if i have following structure: L Menu L Sub menu L Current page L Sub menu 2 L Menu 2 I want to obtain: Menu >> Sub Menu >> Current page I am using WordPress 5.0.2. I tried various plugins but they show only current page instead of whole path. How do i solve …
I've purchased the Yoast SEO Premium plugin earlier this year, but I wasn't able to figure out how to enable breadcrumbs until a few days ago. At first I thought I had to add blocks to every page and post, and I thought that would be incredibly tedious, until I found this article. Since I was already using the Twentytwentyone theme, I decided to add the code to its header.php file. <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb( '<p id="breadcrumbs">','</p>' …
I've used the code from this answer in the breadcrumbs, and it works well. I also added Schema.org markup: https://schema.org/BreadcrumbList Please see at the bottom under "Microdata", It asks to add this line: <meta itemprop="position" content="1" /> under each menu item. I can add it to the home page like this: <ul> <li><a href="<?php echo home_url(); ?>/projects">Projects</a><meta itemprop="position" content="1" /></li> <?php $term = get_term_by("slug", get_query_var("term"), get_query_var("taxonomy") ); $tmpTerm = $term; $tmpCrumbs = array(); while ($tmpTerm->parent > 0){ $tmpTerm = get_term($tmpTerm->parent, …
I have this code for breadcrumbs that works fine except the custom post type parent category URL and the category TITLE. The parent category URL is does not return the valid (correct) slug while its title (anchor) returns a text with description on it like CATEGORY - BOOKS. Although I am a bit of a mediocre in coding but I am open for learning. I figured out the code responsible for displaying the invalid parent category is below elseif ( …
I have this code I got from here on StackOverflow. It works great across my wordpress site but the problem is that on the custom post type single pages, the parent category's link it fetches for every custom post type links to the current post itself and not the parent category link. Again, the title it fetches for same category has some descriptions attached to the anchor (title). For example: Home > Category: Books > Things Fall Apart In this …
I want to use yoast seo breadcrumbs in my web site, but when I set it up, the hierarchy doesn't look right, I have a mega menu and the parent pages doesn't appear in the breadcrumbs For example in this case the breadcumbs should be: Inicio > Productos > Análisis de gases > Analizador o3 instead of Inicio > o3 how can I solve it?
i use astra theme's breadcrumb shortcode into elementor and create pages, but the breadcrumd's begin always shows as "Home" instead of my language. i make a search and find this articles, https://developers.wpastra.com/astra-pro/reference/functions/astra_breadcrumb/ about the line 'home' => __( 'Home', 'astra-addon' ), if i change the Home to my language words,the breadcrumb's "Home" will be translated well. i want to ask if i can add a codes into functions.php and let it replace as my language words well ? thanks
I have a custom post type, Reports, that contains many categories (custom taxonomies). These posts are organised in menus on different pages. So a menu page named "Best Reports" would have multiple sections, ie: *Best Reports* From Today (List of posts tagged with the categories of "best" and "today") From Yesterday (List of posts tagged with the categories of "best" and "yesterday") Another menu page would look like *Worst Reports* From Today (List of posts tagged with the categories of …
I have setup Yoast breadcrumbs in my category pages en posts inside that category page. Category page: home/diensten/ Post page: home/diensten/support/ When I want to navigate back from the support post and click on 'diensten' the link navigates to: home/category/diensten/ instead off: home/diensten/ Any idea how to fix this?
I tried to remove breadcrumbs from homepage because it looks really ugly, but i can't do this because conditionals don't work. *I took that from woocommerce docs add_action( 'init', 'wcc_remove_woo_wc_breadcrumbs' ); function wcc_remove_woo_wc_breadcrumbs() { if ( is_home() || is_shop() || is_front_page() ) { remove_action( 'woo_main_before', 'woo_display_breadcrumbs', 10 ); } } Line remove_action( 'woo_main_before', 'woo_display_breadcrumbs', 10 ); works correct, but unfortunatelly conditional tags don't. Do you have any ida on woocommerce shop page as homepage?