Plugin Author
Ajay
(@ajay)
I’m not familiar with the function to pull the custom excerpt from these plugins, but you could create your own filter in your functions.php to filter crp_excerpt
something like this.
function filter_crp_excerpt( $output, $id, $excerpt_length, $use_excerpt ) {
$get_yoast_excerpt = YOUR FUNCTION HERE TO GET THE EXCERPT;
$output = $get_yoast_excerpt;
return $output;
}
add_filter( 'crp_excerpt', 'filter_crp_excerpt', 10, 4 );
Well, I saw cases of one plugin importing data from another (completely different authors) and I just hoped you could implement something like that to the most popular SEO plugin.
Plugin Author
Ajay
(@ajay)
Hi, You can use $wpseo_front->metadesc
to get the meta description.
Can you try adding this to your functions.php of your theme. Please note that this isn’t tested. It requires you to have WordPress SEO by Yoast activated. Please make sure you backup the original files when replacing them.
function filter_crp_excerpt( $output, $id, $excerpt_length, $use_excerpt ) {
$output = WPSEO_Meta::get_value( 'metadesc' , $id );
return $output;
}
add_filter( 'crp_excerpt', 'filter_crp_excerpt', 10, 4 );
Hi Ajay,
I know I can modify my code, but my idea was that your plugin fetches the data. WordPress SEO by Yoast has about 12.25 mln downloads, All in One SEO Pack has more than 19 mln downloads. They are widely used and I think lot of people would appreciate if your plugin could fetch the meta descriptions from them.
I see it like that: if there is a WP excerpt, take it, if not check for existence of WordPress SEO by Yoast and All in One SEO Pack and take meta descriptions from one of them – I don’t think anyone would have them both installed.
Google, Facebook, Bing and all other sites correctly see the proper excerpt from my SEO plugin, it is only your plugin that doesn’t see it. I would love to have such possibility added to your plugin, as it is one of the best related comments plugins.
Thank you in advance for considering it.
Plugin Author
Ajay
(@ajay)
Understood. Does make sense. Let me put this on my list of things to add to the plugin.
Awesome, thank you so much! For the time being I am marking this topic as resolved.