Call posts with same tag (using title) in specific categories
-
I am trying to call relevant posts to the current post, but only from certain categories. Specifically, I want to use the has_tag function with the in_category function. However, I want to use the title of the post as the tag that it searches, but only within the 4 categories I’ve listed below.
Here’s what I’ve got so far (that isn’t working):
<?php $title = get_the_title(); if(has_tag($title) && in_category(array('10','12','21','22'))){ ?> Content here <?php } else {} endwhile; endif; ?>
Please help! Thank you
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Call posts with same tag (using title) in specific categories’ is closed to new replies.