WordPress.org

Ready to get started?Download WordPress

Forums

[Theme: Twenty twelve] Display categories as a page in top menu (7 posts)

  1. Dravel
    Member
    Posted 1 year ago #

    I been searching for this answer, i have a child-theme set up for my Twenty Twelve and i want to create a page that will list all my categories with the post titles posted in every category, i then want to post that page as a link in the top horisontal menu, how would i do that?

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    I think you can set up a Custom Menu to include your categories in Appearance > Menus section of the dashboard.

  3. Dravel
    Member
    Posted 1 year ago #

    Hmm, not really what i was after. I want to have a link that leads me to a page where all categories are listed + the post titles. So basiclly i want to create a single page that fetches the categories i have (with post-titles) then have a link to that page in the top menu

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    For the single page part, you can create a template file in your Child Theme and play about with the category function.
    E.g;

    <?php
     $categories = get_categories();
    
     foreach ( $categories as $category ) {
      echo $category->name;
     }
    ?>
  5. Konstantinos Kouratoras
    Member
    Posted 1 year ago #

    You can use shortcodes to display categories posts using "List category posts" plugin.

    http://wordpress.org/extend/plugins/list-category-posts/

  6. Dravel
    Member
    Posted 1 year ago #

    That's actually the action i'm after but want to do that without a plugin...

  7. Konstantinos Kouratoras
    Member
    Posted 1 year ago #

    Then, create a new page template, get the categories list with get_categories() and for each category call WP_Query() with category id as argument and list posts.

    So you can create a new page in WordPress admin and assign to it the new page template.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.