Dynamic Content Author Title

Hi there, I am using a dynamic content shortcode to pull in the category Title. With Yoast, I can set the primary category but the dynamic content doesn’t read that so it just pulls the first category alphabetically. Is it possible to have the Title pull in the primary category? https://live-rns-dc.pantheonsite.io/2019/09/23/religious-americans-are-overly-pessimistic-about-the-family-study-finds/

Hello Susan,

Thanks for writing in!

Are you using this {{dc:archive:title}} dynamic content? This will only work if you are in a category page and will only get the first category title which is in alphabetical order. I would recommend that you use specific category instead like {{dc:archive:title term="123"}} where {123} is the category ID.

Please let us know how it goes.

I am using that dynamic content. It’s on the blog post page and working but I want it to pull the primary category of the single blog post. is there no way to have it automatically pull in the primary category? I don’t want to use the specific category ID because the sidebar is on different authors’ posts and I want it to pull in the primary category of each post. Thanks

Hello @suzannereid,

You are using the dynamic content incorrectly.

To display the category title, you will have to add dynamic content which is for the category archive pages. If you want to use dynamic content for the single posts, you will have to use the dynamic content for posts. The problem is that you cannot display the category names using the dynamic content because it is not meant to display the category names. You are only milted to the given options.

You will have to use custom code or shortcode that will display the category name instead. Perhaps this link might help you:

Hope this helps.

hmm. But it is working on the single post–it’s just pulling the category in alphabetical order rather than the primary category which I would like it to pull in.

See the sidebar on this page: https://live-rns-dc.pantheonsite.io/2019/09/23/religious-americans-are-overly-pessimistic-about-the-family-study-finds/

Hi @suzannereid,

Unfortunately, category is not fully supported yet on post. There’s a request already in place to add it on dynamic content for post. At the moment, the only option to achieve it is via custom code as suggested by @RueNel.

1 Like

Alright, Thanks @Lely and @RueNel

You’re always welcome @suzannereid!

Cheers.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.