• 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

Custom loop on Category pages

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 › Design Tips and Tricks › Custom loop on Category pages

This topic is: not resolved

Tagged: conditional tag, custom loop

  • This topic has 3 replies, 2 voices, and was last updated 11 years, 4 months ago by Summer.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • January 11, 2014 at 2:04 pm #84659
    lsnoei
    Member

    I would like my Genenis Child theme to have a custom loop on Category Pages.
    I tried this (in functions.php):

    if ( is_category() ) {
    remove_action('genesis_loop','genesis_do_loop');
    add_action('genesis_loop','custom_loop');
    }
    
    function custom_loop() {
    while(have_posts()) : the_post();
    echo '<div class="loopthumbnail">'. the_post_thumbnail('thumbnail') .'</div>';
    echo '<div class="loopdate">'. the_date() .'</div>';echo '<div class="looptitel"><a href="'.get_permalink().'">'.get_the_title().'</a></div>';
    echo '<div class="loopexcerpt">'. the_excerpt() .'</div>';
    endwhile;
    }

    If I remove the category-condition, it works. Only then it works throughout the site, whilst I want it to work only on category pages. Hope someone can help.

    http://abeontwerp.nl/
    January 11, 2014 at 5:29 pm #84676
    Summer
    Member

    Do not place it in functions.php. Create a new template called category.php, put the code for the loop in the new template.

    After that, every category defined by your site would use that custom loop.

    Read more about WordPress templates here: http://codex.wordpress.org/Template_Hierarchy


    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

    January 12, 2014 at 8:38 am #84757
    lsnoei
    Member

    Hi Summer, thank you for taking the time to help me. It worked. I wil now try to figure out how to customize my new category page into a design that I like. Slowly I'm learning.

    January 12, 2014 at 9:50 am #84769
    Summer
    Member

    You're welcome... glad it worked!

    I guess I'm just old school. I think everyone should learn the different templates... it keeps functions.php uncluttered 🙂


    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2025 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