• Resolved NeoconNews

    (@neoconnews)


    I was just wondering if there is a plug-in or command to automatically list all the blog categories that wordpress has? I know you can sort pages by categories, but I just want to make an automated list of all the categories I have. It would be nice to be able to have a bit of commentary between them, but more than acceptable if it were just the list.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Easy enough, NeoconNews. Here’s how.

    Thread Starter NeoconNews

    (@neoconnews)

    Okay, I still feel stupid. I’ve been trying to input this code into a new page in wordpress, and everything keeps disappearing.

    Here’s the code:

    <ul>
    <?php wp_list_cats('sort_column=name&optioncount=1'); ?>
    </ul>

    You should never put php code in the content of a post or Page. It doesn’t work.

    Moshu’s right, technically, but there is something you can do.

    I assume this is for a particular page? If so, make a custom page template. Put the wp_list_cats (or wp_list_categories depending on your version of WP) inside the template for that page.

    Hmm. You know, it would be easier for you and me both if I just did it and sent it rather than write out all the steps.

    Please download http://designorati.com/_temp/page-categories.txt

    Once you download it, rename the file extension from .txt to .php and open the file in your HTML editor. It’s a real barebones template (made from the Default WP page.php template). Inside the page-categories.php you’ll see a comment where I inserted the hard coded content–the category list–right after the dynamic content–whatever you enter into the content field on the Write > Page screen. Make any changes needed in order to make the template match your site.

    Really, all you have to do copy everything from your current page.php template. Just ensure that the hard coded page content remains as does the PHP comment at the top. The latter is necessary to tell WP that it’s a template.

    Upload page-categories.php to your template directory.

    In WP, edit the page you want to use for the category list in the editor. You’ll see a box labeled “Page Template” and a dropdown menu. Inside the dropdown menu you should now have an entry for “Page with Categories,” the new template. Choose that template and save the page. That will put the category list onto that page for your blog.

    If you only want the category list and nothing else on the page, leave the content field empty on the Edit > Page screen.

    Let me know if any of this isn’t clear.

    PS: There ARE plugins available that enable you to insert and execute PHP code from within posts and pages. In this case, however, you shouldn’t use them. You’re much better off with a hardcoded custom template.

    Thread Starter NeoconNews

    (@neoconnews)

    Wow! I really have to say thank you! You explained it perfectly, and I got it working right away. Thank you so much for the help, I really do appreciate it! It isn’t anything fancy, but it certainly makes me feel better.

    Very cool, NeoconNews. I’m glad I could help. I see it running on your site. Looks good.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Make an automated category page?’ is closed to new replies.