Is there any **{{dc ...}}** syntax in order to receive Category for both ARTICLES and PAGES?

Hi

I’ve create an Archive Template for Search Results with Layout Builder with the following condition:

image

The search returns both pages and articles.

If I add the following Dynamic content:
{{dc:term:name}}
It receive a Category name only for ARTICLES and NOT for PAGES

If I add the following Looper:
image
I receive all Category names for both ARTICLES and PAGES

Is there any {{dc …}} syntax in order to receive Category for both ARTICLES and PAGES?

Thank You

Hello Daniele,

Thanks for writing to us.

In WordPress, there is a category option only in the posts whereas there is no option to assign the page into a category. The dynamic content code {{dc:term:name}} is used to pull the category name. It is applicable for all the posts and custom post types. In case if you have done any customization on the page to categorize it we need to check your settings to advise you how to pull the category name so I would request you please share your details in a secure note. Please provide the following details

  • WordPress Login URL
  • Admin level username and password
  • Exact Layout name

You can find the Secure Note button at the bottom of your posts

Hope it helps
Thanks

Here are Secure Note

Hello Daniele,

Since the pages do not have categories, you can add a condition to your DIV element that displays the categories that it will only display except for pages.

Hope this would work out for you.

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