• Resolved paa1605

    (@paa1605)


    Hey guys,

    Can anyone help. I have a post archives dropdown box on the sidebar of several pages of my site. For some reason whatever month you click on re-directs back to the home page instead of showing the correct posts. The site is boutiquehandbags dot co dot uk. Here is the code i am using to create the dropdown box. Any help is very much appreciated.

    <select name="archive-dropdown" class="postform" onchange="document.location.href=this.options[this.selectedIndex].value;">
      <option value=""><?php echo esc_attr( __( 'Select Month' ) ); ?></option>
      <?php wp_get_archives( array( 'type' => 'monthly', 'format' => 'option', 'show_post_count' => 1 ) ); ?>
    </select>
Viewing 4 replies - 1 through 4 (of 4 total)
  • Why aren’t you just using the default WordPress archives widget, and ticking the “display as dropdown” and “show post counts” options?

    Regardless, this archive plugin is an alternative, so you don’t have to tinker with your core WordPress code. And it’s a good idea not to tinker w/ the core WP code, ’cause once you upgrade after the next update, it’s gone.

    Moderator keesiemeijer

    (@keesiemeijer)

    Do you disable the date-based archives with the WordPress SEO plugin?

    Try:
    – deactivating all plugins to see if this resolves the problem? If this works, re-activate the plugins one by one until you find the problematic plugin(s).

    – switching to the default theme to rule out any theme-specific problems.

    Good point, kees … if you have WordPress SEO installed …

    1. Go to your wp-admin
    2. Click SEO in the left column
    3. Go to Titles & Metas
    4. Click the Other tab
    5. Uncheck Disable the date-based archives
    Thread Starter paa1605

    (@paa1605)

    Thanks for the help guys.

    After taking what you said onboard it turns out it was indeed a problem with the ‘disable date-based archives’ in the seo plug-in. All fixed now and working perfectly. Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Problem with post dropdown archive box’ is closed to new replies.