Cloud library single, get post category

Posted in: Newspaper
Post count: 45

Hi everyone,

I am on Newspaper 10.4 and I have a cloud template element (specifically tdb_single_subtitle.php) where I currently inject some custom code:


$buffy .= '<div class="tdb-block-inner td-fix-index">';
$buffy .= '<div id="mycustomdiv"><p>';
$buffy .= '<b style="margin-left:20px;"> Price: </b>' . get_field('field_price');
...

This works just fine, but what I would like to add here is a category check.
In the past, when all of this stuff was in other php files, I would do something like “if (has_category(’16’))”

How can I achieve the same thing?

Thanks

Post count: 45

Well, never mind, I could just use the same syntax as before with “if (has_category(’16’))”, I dunno why it was not working before

Post count: 27744

Hello,

I’m glad that you find the solution.

Have a great day!

Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.