Hi,
Thanks for your reply, but what I was actually looking for was to have the results of the posts/pages/products listed on my search results page to use those posts/pages/products’ SEO descriptions that I set using AIOSEO.
I was able to do that by copying the search results template to my child theme and replacing the description hook for the search results page.
For anyone else who comes across this using the Avada theme, the file is /templates/blog-layout.php around line 329
<div class="fusion-post-content-container">
<?php
// custom AIOSEO meta description for search results
if ( is_search() ) {
if (function_exists('aioseo')) {
$aioseo_description = aioseo()->meta->metaData->getMetaData($post)->description;
if(!empty($aioseo_description)) {
$post_id = get_the_ID();
$get_post = get_post($post_id);
$meta_description = aioseo()->meta->description->getPostDescription($get_post);
echo $meta_description;
}
}
}else{
/**
* The avada_blog_post_content hook.
*
* @hooked avada_render_blog_post_content - 10 (outputs the post content wrapped with a container).
*/
do_action( 'avada_blog_post_content' );
}
?>
</div>