iboregua
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: Custom page template and dynamic slugsHello, @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 theproduct_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!
Forum: Themes and Templates
In reply to: [Neve] Customize Header strips out linksNow all of the sudden the links are there…
Forum: Plugins
In reply to: [Smart Marketing SMS and Newsletters Forms] Cron jobThanks 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
Forum: Themes and Templates
In reply to: [Twenty Seventeen] Toggling mobile menuThank 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. ??
Forum: Themes and Templates
In reply to: [Twenty Seventeen] Toggling mobile menuThank 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