RC1 - breadcrumbs

Hi Guys,

I am re-building a non-pro site onto Pro Beta 3 RC1

The problem I have is I am using ‘The Grid’ as my blog index page and using breadcrumbs on the blog pages… currently the breadcrumb show Home / Blog / Post, where the Blog breadcrumb points to root home page

How can I point the ‘Blog’ to the correct page (/latest-news/) and rename ‘Blog’ to ‘COURSES & NEWS’

Site links below

So this happens because the Breadcrumbs is expecting a “Posts Page” to be set. Couple of options here:

  1. You could set the Posts page in Settings > Reading. Now your Breadcrumb element will just work naturally. To output your grid, override x/framework/views/global/_index.php in a child theme and have it run do_shortcode('your grid shortcode');
  2. Use the code below:
// Tell Pro to use a different Blog Label
add_filter('x_breadcrumbs_data_args', function( $args) {
$args['blog_label'] = 'Course & News';
  return $args;
});

// Tell WordPress that the Post Archive link is somewhere else
add_filter('post_type_archive_link', function($link, $type) {
  if ($type === 'post') {
    $page = get_page_by_path('latest-news');
    if ($page) {
      $link = get_permalink( $page );
    }
  }
  return $link;
}, 10, 2);

Also, instead of typing it in all caps you can use the “Links Text Format” control and set your CSS text-transform to uppercase (first button). That will give you a consistent style without having to manage it at the data level.

That 2nd option works perfectly! thank you

I need to speak to the client about the text transform as they have been inconsistent with their titles and need to find out what they want

the first option could also work, and I like the idea of it and will explore that further (ie global block page to replace an index page)

Thanks again for the help

Ok great! Glad to hear that worked nicely. Yes, a Global Block would be a good alternative. This is another good case of something the Layout builder will resolve naturally.