• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

List post titles under each category

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › List post titles under each category

This topic is: not resolved

Tagged: list; categories; page

  • This topic has 3 replies, 3 voices, and was last updated 12 years, 10 months ago by jennifergrayeb.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 9, 2012 at 9:12 pm #4097
    khcreativemedia
    Member

    Hello all,

    I'm trying to create a page that shows the name of each category with a list of all post titles associated with that category. Each title should also be linked to the post. This will be for a blog with thousands of post. It needs to be similar to http://michaelhyatt.com/archives.

    I want to do it in a way that creates the least amount of page load time and calls to the database as well.

    Thanks for your help,

    Keith

    December 10, 2012 at 9:24 pm #4377
    Susan
    Moderator

    Keith:

    This tutorial might help:

    http://www.wphub.com/tutorials/list-posts-from-one-category/

    December 10, 2012 at 11:12 pm #4401
    khcreativemedia
    Member

    Thank Susan. I just got it to work using the following code:

    <?php
    /**
    * Template Name: Minimum Archive
    */

    add_action( 'genesis_after_loop', 'custom_archives' );
    function custom_archives() {
    echo '<div>';
    $cats = get_categories();
    foreach ($cats as $cat) {

    echo $category->name; //category name
    $cat_link = get_category_link($category->cat_ID);
    echo '<h3><a href="'.$cat_link.'">'.$cat->name.'</a> </h3>';

    query_posts('cat='.$cat->term_id.'&showposts=500');

    echo '<ul>';

    while(have_posts()) : the_post();?>

    <li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?> - <?php the_date(); ?></a></li>

    <?php endwhile;

    echo '</ul>';
    }
    ?>
    </div>

    <?php
    }
    genesis();

    August 26, 2013 at 4:06 pm #58935
    jennifergrayeb
    Participant

    Did anyone find a solve for this? I see the code above but I'm not sure where I'm supposed to place it.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble