Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter iboregua

    (@iboregua)

    Hello, @bcworkz,

    Thanks for your reply! I do flush the rules. This part of code is already one year old. It is just that we decided for Yoast now and we would like to use their breadcrumbs too. I resolved the issue (partly, I suppose) with the wpseo_breadcrumb_links hook (if somebody encounters the same problem):

    add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_add_fillday_link' );
    
    function wpseo_breadcrumb_add_fillday_link( $links ) {
        global $post;
        if ( ((array)(get_post()))['post_name'] == 'hello-world' ) {
            $siteUrl = site_url();
    		$branch = get_branch();
    		if ( $branch ) { 
    		    $branch_label = get_branch_label( $branch );
    		    $breadcrumb[] = array(
                    'url' => $siteUrl . '/' . $branch . '/',
                    'text' => $branch_label,
                );
                array_splice( $links, 1, -2, $breadcrumb );
                
    		    $range = get_query_var('range');
        		if ( $range ) { 
        		    $range_label = get_range_label( $range );
                    $breadcrumb[] = array(
                        'url' => NULL,
                        'text' => $range_label,
                    );
                    array_splice( $links, 1, -1, $breadcrumb );
                    
                    $family = get_query_var('family');
                    if ( $family ) {
        		        $family_label = get_family_label( $family );
                        // array_splice( $links, 2, 1 );
                        array_pop($breadcrumb);
                        $breadcrumb[] = array(
                            'url' => $siteUrl . '/' . $branch . '/' . $range . '/',
                            'text' => $range_label,
                        );
                        array_splice( $links, 1, -1, $breadcrumb );
                        
                        $breadcrumb[] = array(
                            'url' => NULL,
                            'text' => $family_label,
                        );
                        array_splice( $links, 1, -1, $breadcrumb );
                        
                        $product = get_query_var('product');
                        if ( $product ) {
        		            $product_label = get_product_label( $product );
                            // array_splice( $links, 3, 1 );
                            array_pop($breadcrumb);
                            $breadcrumb[] = array(
                                'url' => $siteUrl . '/' . $branch . '/' . $range . '/' . $family . '/',
                                'text' => $family_label,
                            );
                            array_splice( $links, 1, -1, $breadcrumb );
                        
                            $breadcrumb[] = array(
                                'url' => NULL,
                                'text' => $product_label,
                            );
                            array_splice( $links, 1, -1, $breadcrumb );
                        }
                    }
        		}
    		}
        }

    I know it could be resolved with kinda while loop but for these four labels that we will use forever and ever I just wrote it without the loop.

    The
    $branch_label, $range_label, $family_label, $product_label sentences are just used to show the very human names of branches, ranges families and products and are not important.

    Also, breadcrumb[] array is accumulating levels so at one step I insert NULL for the url and in the next step I insert the real url part but before that I need to pop the last breadcrumb (having no url). This makes the last part always unclickable – without link. E.g. when we have in address bar:
    https://example.com/lampadas/range_1/family_1/product_1/
    the breadcrumbs appear like:
    home > lampadas > range_1 > family_1 > product_1
    all the breadcrumbs are clickable except the product_1 breadcrumb.

    I took the solution from yoast_seo_breadcrumb_add_woo_shop.php. The solution does not insert the id element though which is inserted by Yoast in ‘normal’ WordPress pages. So, I don’t know if the breadcrumbs are connected with google or not.

    I will try the pre_get_posts action too, thanks for the hint! And, yes, I will contact Yoast too, although my company doesn’t like prepaid plans.

    Thanks a bunch!

    • This reply was modified 2 years ago by iboregua.
    • This reply was modified 2 years ago by iboregua.
    • This reply was modified 2 years ago by iboregua.
    Thread Starter iboregua

    (@iboregua)

    Now all of the sudden the links are there…

    Thread Starter iboregua

    (@iboregua)

    Thanks for a quick reply!

    I can disable the cron in the file. But then I’d need to change for every new version of the plugin.

    In the: WP Dashboard | Smart Marketing | Configuration

    Does the switch Enable Auto Sync has the same function (switching of the cron)?

    Best regards,

    Igor Beuermann

    Thread Starter iboregua

    (@iboregua)

    Thank you Davis for your help! I’ll take a closer look at .js. But there’s a lot. I was looking for “menu-toggle” string yesterday. But I didn’t find the point of decision. For now ??

    Have a nice day, if I’ll find the solution I’ll be back. ??

    Thread Starter iboregua

    (@iboregua)

    Thank you Davis,

    However, I’d like to diminish width of the device where the top-menu gets it’s button and menu-toggle class (toggles between mobile and desktop). Now the widest screen that has the menu button is 767px (at 768px = 48em jumps to desktop version). I would like set this change to +- 600px (37.5em). Then I would make the changes you proposed for the tablet and desktop versions.

    Let’s explore more ??

    Igor

Viewing 5 replies - 1 through 5 (of 5 total)