Forums

How can wordpress TOC appear automatically on old html pages? (4 posts)

  1. kleeyoung
    Member
    Posted 3 years ago #

    I have html sites that have wordpress blogs within them in a sub folder. Home page is index.html.

    I write new articles using wordpress, but obviously those are not shown in the table of conents in the sidebar on the old html pages, of which there are many!

    Is there a way to get an auto updating table of contents that would allow wordpress in a subfolder to appear on these static html pages. By the way, the html page's TOC's are in inculde files.

    thanks!

  2. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    Provided that you included "TOC" files are of the php variety, a simple solution can be found by adding the following code to the begining of you TOC files:

    require('./wp-blog-header.php');

    This will load wordpress making all of it's functions available to you. Now you can use anything that you like:

    wp_list_pages();
    wp_get_archives();
    php wp_list_categories();
    php wp_list_bookmarks();

    If your included are of the html variety, the best option might be to make new TOC files with a php extension and then use mod_rewrite to route requests.

  3. kleeyoung
    Member
    Posted 3 years ago #

    Thanks. And readers: you might want to check this out...

  4. Michael Fields
    Theme Wrangler
    Posted 3 years ago #

    No problem, thanks for posting the link!

Topic Closed

This topic has been closed to new replies.

About this Topic