Archives shortcode not working for me

  • Author
  • #1979682


    My home page is a static page called “About,” and my posts page is called “Blog.” In “Blog,” I inserted this customized archives shortcode:
    [archives type=monthly format=html limit=6 showcount=true before='here they are' after='there they were' order=asc]
    Yet nothing like that shows. All I see is the usual archives in descending order. It seems like the archives shortcode has no effect. Am I missing something?

    The blog I need help with is


    I would expect to see a list of months. After each month is the number of posts. Before each month would be the text “here they are” and at the end of each line “there they were”.

    Clicking on a month would take you to a page showing snippets? From each of the posts for that month.



    Did you set the “Blog” page as the posts page under Settings ->Reading? If you did, then that menu link will only display your main feed and no static content you add on that page will have any effect.

    If you want the “Blog” page to display the archive rather than the main feed you’ll have to go to Settings ->Reading and deselect it next to posts. Then that page will behave like a regular page and the shortcode should work.



    @kokkieh, yes, I set the “Blog” page as the Posts Page under Settings->Reading, according to the directions on WordPress Support | Setting up a Static Front Page.

    The directions on WordPress Support | Archives Shortcode don’t say it could not be used on the Posts Page, so I assumed it could be.

    Based on what you said, I decided to try putting the shortcode on another page, my “Calendar” page, and it worked.

    @knashermac2009 I found out that the rendering of the shortcode inserts no space after the “before” text or before the “after” text, so if you don’t want “here they areMarch 2014 (3)there they were” you have to add spaces inside the single quotes in the code. I decided to add spaces and arrows, like so:

    [archives type=monthly format=html limit=6 showcount=true before='here they are→ ' after=' ←there they were' order=asc]

    And what I got was:

    here they are→ March 2014 (3) ←there they were
    here they are→ April 2014 (8) ←there they were
    here they are→ May 2014 (7) ←there they were
    here they are→ June 2014 (6) ←there they were
    here they are→ July 2014 (22) ←there they were
    here they are→ August 2014 (1) ←there they were

    @wordpress, the bottom line is that the Archives shortcode has no effect in the Posts Page, right?



    P.S. @knashermac2009, whole posts, not snippets, were displayed, except on posts in which I inserted the “More” shortcode.

    I guess I’ve got the technology figured out with your help, @kokkieh. Now I’m trying to figure out where I might want to insert these archives links, and what useful text could I insert “before” and/or “after” if any. Any Web design ideas would be appreciated.

The topic ‘Archives shortcode not working for me’ is closed to new replies.