Featured / Breaking News Post Outside Loop
-
I am making a WordPress theme that displays a breaking news post above the content and sidebar (outside the loop). I am using the following code to display any post with the tag “breaking”:
<?php if ($all_the_tags); $all_the_tags = get_the_tags(); foreach($all_the_tags as $this_tag) { if ($this_tag->name == "breaking" ) { ?> <div class="breaking-news"> Post with tag 'breaking' goes here. </div> <!-- end .breaking-news --> <? } } ?>
So my question is how can I basically create a separate loop in that if statement to display any posts with the tag ‘breaking’?
I am not very good with PHP so an explanation would be extremely helpful! Thank you so much! ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Featured / Breaking News Post Outside Loop’ is closed to new replies.