Browser: Chrome 112.0.5615.50 (Official Build) (64-bit) OS: Windows 11 Dev preview build 25314 URL: running on a .local site with Local by WP Engine Video: Short screen recording that illustrates this issue Bird Eats Bug
I set up a posts query on the category ‘News’ and want the dynamic data result of {post_terms_category} displayed in the heading of the page. As shown in the attached birdeatsbug video, {post_terms_category} is never replaced with ‘News’ in the builder and is blank on the front end. In the video I was following, {post_terms_category} gets replaced with ‘News’ in the builder and on the front end, it ends up with ‘Category: News’ for the heading. It’s totally possible I’m doing this all wrong but from what I can tell, I should end up with the same result as in the video. Hopefully, the attached birdeatsbug screencast will adequately describe what I’m trying to do
Thanks @itchycode for the response. I’m trying to display the Category that the archive page is filtered on which is ‘News’. I’m not sure if the page is a query loop or not but in the ‘Query’ section of the Post element, I specified News(Category) for the ‘Include’ terms. I’m not trying to display the post title. Did you look at the video I linked to that I was following along with to set this up? From what I can understand, I should end up with an archive page with the search term displayed in the heading as shown in the video I linked to(not the screencast I provided). Anyway, thanks for your time.
I used {archive_title} for the dynamic data in the heading and as expected, it displayed ‘Archives’ which is not what I want. When I use {post_terms_category} it displays nothing when I would expect it to display the category of the posts that are being queried. The fact that nothing is being returned at all is what made me think there might be a bug. Thanks.
Are you working with a Bricks (archive) template or a regular page? Since the {archive_title} dynamic tag does not work for you I guess you’re working with a regular page. In this case you have to explicitly set the title to whatever you want it to be – just like you explicitly set the Posts element’s query args to only fetch items from the News category.
Because this tag outputs the categories applied to a post. And since you are in an archive template (and not within a single template or a post loop) there is no post to get the categories from.
Since you’re working with an archive template: Could you show the template conditions?
Hi @itchycode. {archive_title} populates fine in the frontend. I’m still wondering why {post_terms_category} does not populate at all in the frontend. However, I’m trying to display the category of the posts listed on the archive page, not the archive title.