WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Archive links not working (9 posts)

  1. HeleneV
    Member
    Posted 2 years ago #

    I am trying to make an archive list in my sidebar showing month, year and number of post, that works with this code <?php wp_get_archives('type=monthly&show_post_count=1'); ?> that I have inside my sidebar2.php which is included with <?php include ('sidebar2.php'); ?> on the page that i want the sidebar AND the archive results to show.

    My problem is that the links that appear (like april 2012 (2)) just takes me to the index file..

    How do i get them to show whats actually posted in april 2012? I'm a neewbie so please be gentle ;)

  2. TheMarque
    Member
    Posted 2 years ago #

    Try this:
    <?php wp_get_archives(apply_filters('widget_archives_dropdown_args', array('type' => 'monthly', 'format' => 'option', 'show_post_count' => $c))); ?>

    Of course, the real problem might be that you do not have an archives template. Do you? (Check in Appearance >Editor)

  3. HeleneV
    Member
    Posted 2 years ago #

    Actually I do have an archives template named archives.php if thats what you mean?
    It looks like this:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    I don't actually know whats suposed to stand there, so please tell me if you do..

  4. TheMarque
    Member
    Posted 2 years ago #

    Yea, that really doesn't look like a good archives template to me. (By the way, here is your pastebin code http://pastebin.com/kyrmyrVP )

    Replace code with this:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  5. HeleneV
    Member
    Posted 2 years ago #

    Your code disapeared, will you post it again?

  6. HeleneV
    Member
    Posted 2 years ago #

    Nevermind, got the code in my mail..
    But it doesn't work, still the same results as always, the only thing that shows up is my index page even if the adress is right: http://localhost:8888/wordpress/2012/04

  7. TheMarque
    Member
    Posted 2 years ago #

    So, this is resolved, HeleneV?? You fixed your problem? Also the link you posted above isn't a valid URL

  8. HeleneV
    Member
    Posted 2 years ago #

    Yes. I know, it was just to show how the adress looked like even if the page was the index.

    I now have this in my sidebar:

    <?php wp_get_archives(apply_filters('widget_archives_dropdown_args', array('type' => 'monthly', 'show_post_count' => $c))); ?>

    And this in my archive.php:

    http://pastebin.com/pa2f4fwt

  9. klevismiho
    Member
    Posted 1 year ago #

    You should create an archive.php page.

Topic Closed

This topic has been closed to new replies.

About this Topic