• Resolved HeleneV

    (@helenev)


    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 😉

Viewing 8 replies - 1 through 8 (of 8 total)
  • TheMarque

    (@themarque)

    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)

    Thread Starter HeleneV

    (@helenev)

    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..

    TheMarque

    (@themarque)

    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]

    Thread Starter HeleneV

    (@helenev)

    Your code disapeared, will you post it again?

    Thread Starter HeleneV

    (@helenev)

    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

    TheMarque

    (@themarque)

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

    Thread Starter HeleneV

    (@helenev)

    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

    You should create an archive.php page.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Archive links not working’ is closed to new replies.