Thread Starter
csleh
(@csleh)
Right, that’s what I understood the code to be.
Here’s the goal:
category 3 is news. Everything in news should look the same, generally. There is one post (50) that is info for media. The site uses breadcrumbs, so you can see the path on the page. If you are looking at a press release (99% of news category items), you should see the date posted. But if you are looking at the media info page, the posting date doesn’t make sense.
There could be a second category that only has the media info, but that would be confusing — not only do I have to pull in an additional category whenever referencing news, but viewers would see a different path in the breadcrumbs.
My thought was that if I could just exclude one post from the in_category call all these problems would be fixed. I am open to any suggestions?
Thread Starter
csleh
(@csleh)
I’m sure there is a cleaner way, but adding another if-else inside the first one (for category) to test for a single post with ID of 50 (the media sheet) did the trick.
<?php if (in_category('3')) : ?>
<?php if( is_single(50) ) : ?>
<?php else : ?>
<p class="newsdatepage">TROY, MICHIGAN — <?php the_time('F d, Y') ?>
<?php endif; ?>
<?php endif; ?>
Cleaner way:
<?php if (in_category('3') && !is_single(50)) : ?>
<p class="newsdatepage">TROY, MICHIGAN — <?php the_time('F d, Y') ?>
<?php endif; ?>
Thread Starter
csleh
(@csleh)
OK, so the "&& is saying “if this is also true” and the ! is saying “leave this one out”. Is that right?