• I’m including an “archive” of posts to include in a sidebar on my single.php page.

    How do I format it to the way I want it to look? Right now, this is the code I’m using

    <?php wp_get_archives( 'type=postbypost&limit=20&format=custom' ); ?>

    But it spits out the post like this in the HTML source:

    <a href"link to post">post title 1</a>
    <a href"link to post">post title 2</a>

    How can I control the formatting so I can include my custom styles to say something like:

    <div class="style for block">
    <div class="style"><a href="link to post">Post Title 1</a></div>
    <div class="style2">Date</a></div>
    </div>
    <div class="separator"></div>
  • The topic ‘How to format output of wp_get_archives ?’ is closed to new replies.