• Resolved umchal

    (@umchal)


    Hi there,

    My site has some pages with the same title like

    – Program A > Tutorials
    – Program B > Tutorials

    Sometimes I see the tutorials page for program B is displayed in Program A’s pages. It’s okay but since only titles get displayed, it’s kind of confusing.

    So I’m wondering if there is an option to display the breadcrumb along with the title like if the target page belongs to a different parent.

    – Tutorials (Program A > Tutorials)

    Or maybe just the breadcrumb would be fine I guess.

    – Program A > Tutorials
    – Program B > Tutorials

    So the visitors won’t get confused.

    https://wordpress.org/plugins/contextual-related-posts/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Ajay

    (@ajay)

    Hi,

    You can’t do that directly with the plugin because the code doesn’t support it.

    You will need to edit the plugin code for this around line 108

    $output .= '<a href="'.get_permalink($result->ID).'" '.$rel_attribute.' '.$target_attribute.'class="crp_title">'.$title.'</a>'; // Add title if post thumbnail is to be displayed after
    Thread Starter umchal

    (@umchal)

    Thanks for the reply.

    If I modify the plugin code, when the plugin is updated, the changes will be gone. So it’s not ideal.

    What about adding a filter like

    $output .= apply_filters( 'some_appropriate_filter_name', '<a href="'.get_permalink($result->ID).'" '.$rel_attribute.' '.$target_attribute.'class="crp_title">'.$title.'</a>' );

    so an extension plugin can be written.

    It would be great if it is implemented as an option though.

    Plugin Author Ajay

    (@ajay)

    Hi,

    The current version of the plugin already has a filter on the title crp_title that can be modified.

    The new version that I am planning on releasing in the next few days also passes the ID of the list item so you can use that to modify the $title variable which is used later on in line 108.

    This is what the code will look like a few lines above line 108

    $title = apply_filters( 'crp_title', crp_max_formatted_content( get_the_title( $result->ID ), $title_length ), $result->ID );

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it possible to display the breadcrumb along with the post title?’ is closed to new replies.