How to make a post tree? With shortcodes?

  • Unknown's avatar

    I’d like to make a page that displays a post tree. I want the title and publication date displayed for each post, listed under annual and monthly headings. Something like this (only with links):

    2013
    January

    • 1 January Happy New Year!
    • 10 January Just another post

    March

    • 8 March One more post

    2012
    January

    • 10 January One more example

    I’ve been playing around with the archives and display-posts shortcodes but I can’t figure out how to do this (if indeed it’s possible).

    Little help? THANK YOU!!!

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there,

    Since you want to list the post titles, I suggest using the Display Posts Shortcode. Here’s an example of the code for a list of posts with the date:

    [display-posts include_date="true" date_format="j F Y" order="ASC"]

    This won’t create a post tree quite like you’re looking for, but it will list the posts in order with the date included. You could also use some tricks with custom CSS to move things around:

    .display-posts-listing .date {
        float: left;
        margin-right: 10px;
    }
    
    #content .page ul li {
        list-style: none;
    }

    Please let me know how that works for you! :)

    If you’d like to play around more with the custom CSS, you can get additional help from volunteers and staff in the CSS Customization forum here:

    https://en.forums.wordpress.com/forum/css-customization

  • Unknown's avatar

    Thank you for the suggestion! I think this is as close as I can get :)

  • The topic ‘How to make a post tree? With shortcodes?’ is closed to new replies.