Okay
  Public Ticket #2646374
Rank math breadcrumb and author drop down
Closed

Comments

  •  5
    Earl D started the conversation

    I use Rank Math SEO and even though I changed the event slug rank math still only read step event. Any ideas why?

    one feature suggestions - Alphabetize the drop down list in the change author event option


  •  877
    Zhivko replied

    Hi,

    If I understand you correctly the breadcrumb doesn't display the repeat offset?

    If that's the case then try following: 

    In your active theme functions.php file add this filter:

    add_filter('rank_math/frontend/breadcrumb/html', function($html, $crumbs, $th) {
        global $post;     if ($post && $post->post_type === 'stec_event') {         $repeat_offset = get_query_var('stec_repeat_offset');         if ($repeat_offset) {
                $arr_html    = [];
                $crumbs_html = [];
                $arr_html[]  = '<nav aria-label="breadcrumbs" class="rank-math-breadcrumb"><p>';
                $event = new \Stachethemes\Stec\Event_Post(get_the_ID());
                $event->set_repeat_offset($repeat_offset);             $separator = \RankMath\Helper::get_settings('general.breadcrumbs_separator');             foreach ($crumbs as $crumb) {                 $crumbs_html[] = sprintf('<a href="%s">%s</a>', $crumb[1], $crumb[0]);                 if (!next($crumbs)) {
                        $crumbs_html[] = sprintf('<span class="last">%s</span>', $event->get_start_date('Y-m-d'));
                    }
                }             $arr_html[] = implode('<span class="separator"> ' . $separator . ' </span>', $crumbs_html);             $arr_html[] = '</p></nav>';             $html = implode('', $arr_html);
            }
        }     return $html;
    }, 10, 3);

    This filter will add the recurrence date at the end of the breadcrumb if there is one.

    I'll add to my todo list to edit the authors list alphabetically.


    Stachethemes Developer