katiecy
Forum Replies Created
-
Forum: Plugins
In reply to: Archives by Date and CategoryThis was easily implemented and worked very well, thanks to rrajakumar and yper for the update!
I have a question about conditional statements using catmonthly and the catmonthly archives.
I used this solution to run the “news” and “events” sections of a website while keeping their archives separate. (It’s behind a vpn or I would link to it here.) I’m using a conditional statement to test for category type and write custom sidebar navigation.
If possible, I would like to make the category have a different class if the user is on the main category page, and each archive have a different class if the user is on that specific archive page. The docs on conditional statements did not address it and I read through the dynamic menu highlighting tutorial.
Is there a way to test for main category page and each archive month in turn?
Here is the psuedo code – I have left irrelevant parts out and my PHP may be seriously flawed. I can figure out the details if you point me in the right direction.
<php /* If this is news */ if (category(2)) { ?>
<h4>News Header</h4>
<ul>
<?php /* If this is news frontpage */ if (is_catmonthly) }{ ?>
<li id="current">Latest News
<?php } else { ?>
<li>Latest News</li>
<?php } ?>
</ul>
<h4>News Archives Header</h4>
<ul>
/* How do I test for active archive title here? Is it even possible? */
<li id="subnavitem"><?php $catmnthquery=("type=catmonthly&mcat=" .$cat); wp_get_archives($catmnthquery); ?>
</ul><?php } else - look for other category { ?>
write other category's code, etc.
<?php } ?>
`I see that I have to define a new conditional statement for catmonthly, “is_catmonthly,” and that there’s a place to do so in functions.php. How would I go about this and what else do I have to do to make it work?
I’m a designer, not a programmer, and am doing my best.
Thanks in advance for your help, and I’m sorry if this isn’t the right place to ask.