Support » Plugin: Contextual Related Posts » Titles Filter?

  • Resolved ctrlaltdelete

    (@ctrlaltdelete)



    Hello i need to add something to titles, i read the plugin has many filters. What’s the name of the title filter? Thanks!

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

    (@ajay)

    Hi could you help me a bit i don’t think i understand how to do this properly.
    So i have a function that adds languages (which is a custom tax) into the titles of the post. I use it like this to apply it yoast seo breadcrumb titles:
    add_filter( ‘wp_seo_get_bc_title’, ‘add_langs’, 10, 2 );
    OR directly on the theme like so:
    add_langs($title)

    Now i want to apply this function to the titles on the related posts plugin. So i tried:
    add_filter( ‘crp_title’, ‘add_langs’, 10, 2 );
    Cleared the related posts cache but it didn’t work.

    Is it possible for me to do this somehow?

    • This reply was modified 4 months, 3 weeks ago by  ctrlaltdelete.
    Plugin Author Ajay

    (@ajay)

    Can you post the exact code that you’ve been using so I can debug?

    My function wouldn’t work unless you also have my database.

    Basically i want to modify the post titles that show up on related posts.

    How could i do that? Say add the letter “a” at the end of all related post titles.

    If you could show me how to do that i can modify it for my specific case.

    Any help appreciated.

    Plugin Author Ajay

    (@ajay)

    The code would be something like this:

    function edit_crp_title( $title, $result ) {
    
    $title = ' HELLO ' . $title;
    
    return $title;
    
    }
    add_filter( 'crp_title', 'edit_crp_title', 10, 2 );
    

    You can use the $result which is the object holding the current post

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.