WordPress.org

Ready to get started?Download WordPress

Forums

How do I create a categories page? (10 posts)

  1. Armin100
    Member
    Posted 5 years ago #

    Hi, How do I create a page that lists all the categories from the blog on that page. Does anyone have a code or plugin for this? Please and Thank You.

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Basically, you make a Page template and put a call to wp_list_categories() in it.

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

  3. Armin100
    Member
    Posted 5 years ago #

    I've tried to create my own page template for this but I received too many php errors. Please help.

  4. wordcastpodcast
    Member
    Posted 5 years ago #

    If you want to go an even easier route without making a page template, just install the Exec-PHP plugin:
    http://wordpress.org/extend/plugins/exec-php/

    and include <?php wp_list_categories() ?> in the page. All done!

    [signature moderated Please read the Forum Rules]

  5. Armin100
    Member
    Posted 5 years ago #

    Exec-php isn't really safe. Last time I used it it rendered my php codes of the website. So im not really going back to that plugin.

  6. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    Well, if you want to run PHP in a Page, then you don't have a lot of options here. Either make a Page Template or use the ExecPHP plugin. Your call.

  7. Armin100
    Member
    Posted 5 years ago #

    I want to make a page template but everytime I do, I get php errors. I don't know why.

    In which wordpress folder am I suppose to place the php file and what codes do I need to put for it to show the template. Every time I attempt this, it ends up with a strange php error.

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 5 years ago #

    I want to make a page template but everytime I do, I get php errors. I don't know why.

    Well, at a guess I'd say that the PHP code you make in your template has errors in it. But that's just a guess. Without more specific details, nobody can answer your question.

    In which wordpress folder am I suppose to place the php file and what codes do I need to put for it to show the template. Every time I attempt this, it ends up with a strange php error.

    Page Templates go in your theme folder, and they only need that bit of header code with the Template Name parameter to show up as a template. The same code as you can find here: http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

  9. Armin100
    Member
    Posted 5 years ago #

    i got it to work but i cant change the font size only for the categories list.

    <font size="10"><?php wp_list_categories() ?></font>

  10. S.K
    Member
    Posted 5 years ago #

    By default the tag wp_list_categories() outputs the "Categories" heading followed by an unordered list of categories. You can change this behaviour by including a parameter "title_li=" to remove the heading and wrapping it with a <ul> or <ol> element and style it with a class.

    That way you can change the font or do any other styling.

    More info about this on this page:

    http://codex.wordpress.org/Template_Tags/wp_list_categories

    HTH

    S.K

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.