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?
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