Can’t get the autogenerated meta description to show up on blog index page
-
Hi!
I can’t get the autogenerated description to display on my blog index page. I have checked that in my query I am using the individual post’s ID, not the index page ID.
I have a feeling it is related to me using custom fields for the text content.
Currently I’m using
the_seo_framework_description_excerpt
filter for feeding the generator with textcontent from my custom text blocks. (get_textcontent() finds all the text field ACF layouts in the post and then returns just the strings).\add_filter( 'the_seo_framework_description_excerpt', function( $excerpt ) { $excerpt = static::get_textcontent(); return $excerpt; }, 10, 2 );
Then using
tsf()->description()->get_description( [ 'id' => $post_id ] )
to output the excerpt on the single blog post page template works fine, and it also outputs nicely in the meta description tags and shows up in admin correctly.I think the issue lies in that on the blog index page I’m not getting the textcontent from all the posts, but I guess that would be necessary for the autogeneration to be able to do it’s thing.
So my question is ?? – is there a good way to get autodescriptions generated from custom fields data on the blog index page?
- The topic ‘Can’t get the autogenerated meta description to show up on blog index page’ is closed to new replies.