Viewing 4 replies - 1 through 4 (of 4 total)
  • Phil

    (@owendevelopment)

    Create a div in your page.php or post.php and add the CSS like your demo link:

    #toc {
        background: none repeat scroll 0 0 #E4F2FD;
        border: 1px solid #D3E7F8;
        border-radius: 11px 11px 11px 11px;
        display: inline;
        float: right;
        font-size: 16px;
        margin: 0 10px 4px 8px;
        max-width: 200px;
        padding: 10px 10px 0;
    }

    Then you need PHP code inside the div to cateorise the pages, something maybe like this:

    <?php wp_list_pages( $args ); ?>

    Good luck.

    Wow—Fast reply! Thanks so much.

    I’m actually hoping get posts instead of pages, using categories as the argument.

    I guess there isn’t a <?php wp_list_posts ('my_category'); ?>? If I just construct the content listing using query_post do you think I could still use the same approach (with #toc…etc..)?

    Thanks again for the quick, helpful reply.

    Terry

    Found a potentially helpful snippet from CSS-Tricks.

    Phil

    (@owendevelopment)

    No problem. Hope you get it sorted.

    Phil

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How is the table of contents achieved on support.WP.com?’ is closed to new replies.