Okay
  Public Ticket #3121316
Breadcrumbs problem
Closed

Comments

  • Chala88 started the conversation

    Hi,

    The breadcrumbs are showing "course layout" instead of course category navigation.

    Example: Unreal Engine 5 para Arquitectura y Archviz - PlanetaCG

    The breadcrumbs shows "PlanetaCG » Course Layouts » Curso PlanetaCG"

    The breadcrumbs must show "PlanetaCG >> Cursos >> Course title"

    Thank you.

  • [deleted] replied

    Which plugin did you use to show breadcrumbs there . Yes actually the course layouts is loaded there for the course with course information . 

    IF the plugin has filter we can modify it to show correct link of breadcrumbs.

  •  6
    Alberto replied

    Hi Alex,

    Thank you for the answer.

    I'm using rank math

  •  6
    Alberto replied

    Hi Alex,

    Thank you for the answer.

    I'm using rank math. Have you workede with It?

    Could you explain how to do It?

    Thanks

  •  6
    Alberto replied

    solved by RankMath support.

    If It helps, They added the following code:


    add_filter( 'rank_math/frontend/breadcrumb/items', function( $crumbs, $class ) {

     if( is_singular('course') ) {

      $crumbs[1][0] = 'Cursos';

      $crumbs[1][1] = 'https://planetacg.com/todos-los-cursos/';

      

      $crumbs[2][0] = get_the_title(get_queried_object_id());

     }

     return $crumbs;

    }, 10, 2);

  • [deleted] replied

    Hi thanks for sharing the code snippet here .