SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    4
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Looking for a simple snippet of PHP code to alter the archive page on my blog

    Hello, I'm glad I found this forum. Hopefully I'm able to find the answer that I'm looking for.

    Anyway, I'm trying to modify my Wordpress blog's archive page in a manner that organizes it like:

    October 2013

    date: post
    date: post
    date: post

    September 2013

    date: post
    date: post
    date: post

    ...and so on.

    For an example of what my ideal archive page would look like, take a look at Steve Pavlina's page here: http://www.stevepavlina.com/blog/archives/

    Now, all of my PHP editing is done using a file called custom_functions.php, which is located in my Wordpress theme folder. I'm using the theme called Thesis.

    Anyway, I've been able to make my archive page look like:

    - post
    - post
    - post
    - post

    ....But I'm unable to FURTHER sort by month, and have the actual date that it was written right next to the title of the post. In fact, here is my archives page: http://www.musicianlifestyle.com/archives-2/

    So basically, I'm trying to get my archives page to look exactly like Steve Pavlina's archive page as shown above.

    The code that I've used thus far, which utilizes the wp_get_archives function looks like this:

    function my_archives_template() {
    ?>
    <h3 class="top"><?php _e('By Month:', 'thesis'); ?></h3>
    <ul>
    <?php wp_get_archives( 'type=postbypost' ); ?>
    </ul>

    <?php
    }

    remove_action('thesis_hook_archives_template', 'thesis_archives_template');
    add_action('thesis_hook_archives_template', 'my_archives_template');

    I know that I'm just one little "snippet" away from altering this code to do what I'm trying to do, but after searching for about 2 straight days...I'm stumped!!!

    Does anyone know what I might be able to do in order to achieve what I'm looking for?

    Thanks a lot!

  2. #2
    SitePoint Member
    Join Date
    Oct 2013
    Posts
    4
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Nevermind everyone....I ended up finding a plugin that does exactly what I was looking for. I wanted to avoid using a plugin, because they tend to slow down my site a lot, but after searching for the answer for two whole straight days, I decided to just settle for a plugin.

    If anyone does happen to know how I would code this myself, so I could add this little "snippet" that I was looking for, I'd still much rather do it that way as opposed to using a plugin. However, I did manage to get my archive page looking just how I wanted it.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •