halo_wordpress

wp_get_archives(‘type=alpha’)

Thanks to a great find. I was able to make some sweet adjustments to my site. With some modification to what JTK said on his website I used some really cool drop down boxes to achieve what I wanted on my site. I will give you the code for both.

First I wanted to make all my posts accessible on any post page. Then after I found that I could do that I found out how to make it not so obtrusive. Because if you have a lot of posts and not a lot of space on your page you don’t necessarily want the first option that JTK had.

So I found a different way and possibly a better one. If you look on my single post page you can see the top, right below adsense (two drop boxes), one with posts most recent and the other with posts alphabetized.

Anyway without further ado, THE CODE:

1
2
3
4
5
6
7
8
9
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'> 
  <option value=""><?php echo attribute_escape(__('Pick a new post to go to! (Most recent to oldest)')); ?></option> 
  <?php wp_get_archives('type=postbypost&format=option&show_post_count=1'); ?> </select><br />
<select name="archive-dropdown" onchange='document.location.href=this.options[this.selectedIndex].value;'>
  <option value="">
   <?php echo attribute_escape(__('Pick a new post to go to! (Alphabetically A-Z)')); ?>
   </option>
  <?php wp_get_archives('type=alpha&format=option&show_post_count=1'); ?>
</select>
GD Star Rating
loading...
GD Star Rating
loading...
wp_get_archives('type=alpha'), 9.0 out of 10 based on 5 ratings

2 thoughts on “wp_get_archives(‘type=alpha’)”

  1. Pretty cool post. I just stumbled upon your blog and wanted to say
    that I have really liked reading your blog posts. Anyway
    I’ll be subscribing to your blog and I hope you post again soon!

    GD Star Rating
    loading...
    GD Star Rating
    loading...
    1. Thank you I found that when I wanted the thing on my header so it was easy to get to certain posts that I use very often to code and so forth.

      GD Star Rating
      loading...
      GD Star Rating
      loading...

Leave a Reply

Your email address will not be published. Required fields are marked *