ericcarl
Member
Posted 1 year ago #
So I'm currently using a drop-down archive menu as is described here:
http://codex.wordpress.org/Template_Tags/wp_get_archives
Now I'd like to combine it with something like this:
<?php if (is_paged()) { the menu; } ?>
... so that the menu only shows up on one of the paged index pages. How would I go about doing this? Attempting to just drop the html drop-down code into the PHP snippet seems to break everything. Thanks!
ericcarl
Member
Posted 1 year ago #
Hey, and I figured it out. Did some Googling and didn't realize you could split PHP code up like this.
<?php if (is_paged()) { ?>
<h2>Archives</h2>
<select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'>
<option value=""><?php echo attribute_escape(__('Select Month')); ?></option>
<?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?></select>
<?php } ?>
Works!