简体   繁体   中英

wordpress breadcrumbs bug "giving styling class to some page and not giving it to other"

i am using Rana theme in WordPress and i face a bug with breadcrumbs in some pages it works perfectly and other it works but with a style bug working breadcrumbs style bug breadcrumbs

ps: while using inspect it seems to give styling class to the working one and doesn't give the styling class to non working one

i searched every breadcrumb setting and search all over the web but i didn't find a clue about what is happening

i just fixed this by editing the theme breadcrumbs code it was missing the url line in the breadcrumbs array

else if ( is_tax('ranna_recipe_category') ){
            
            $terms = get_the_terms( get_the_ID(), 'ranna_recipe_category');
            echo "<script>console.log('" . json_encode($terms) . "');</script>";
            
                                     
            if ( $terms && ! is_wp_error( $terms ) ){
             
                $draught_links = array();
                echo "<script>console.log('" . json_encode($draught_links) . "');</script>";
                
                foreach ( $terms as $term ) {
                    $breadcrumbs[] = array(
                       //Adding this line solve th problem
                        'url'  => $home_url .  $term->slug,

                        'name' => $term->name,
                    );
                } 
            }
        }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM