• 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

Beneaths

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 19, 2014 at 11:50 am in reply to: Custom Category Pages #101302
    Beneaths
    Member

    Ended up brain storming a different way to just push the layout to the client and I'd update him when I figured out a cleaner version.

    Parent Category issue:
    Decided I'd make category specific ID pages so, category-22.php etc in which would have the following code:
    (This would allow for only the main category pages to list off the subcategories)

    <?php
     
    remove_action( 'genesis_loop', 'genesis_do_loop' );
    add_action( 'genesis_loop', 'sk_show_subcategories_do_loop' );
    /**
     * Displays a list of linked child categories on category pages
     */
    function sk_show_subcategories_do_loop() {
     
    	$cat = get_query_var('cat');
    	$category = get_category ($cat);
     
    	if ($category->cat_ID) {
    		$children = wp_list_categories("orderby=id&depth=0&hide_empty=0&title_li=&child_of=".$category->cat_ID."&echo=0");
    		// change depth to 1 if only the top level sub categories should be shown i.e., with children NOT expanded
    		if ($children) {
    			echo $children;
    		}
    	}
     
    }
     
    genesis();

    Subcategory issue:
    And to solve the subcategories only listing off the posts in the titles only, I used the following code:
    (Subcategories would only display post's titles)

    add_action( 'pre_get_posts', 'sk_show_titles_only_category_pages' );
    /**
     * Show Linked Titles Only for Posts in Category Pages
     */
    function sk_show_titles_only_category_pages( $query ) {
     
    	if( $query->is_main_query() && $query->is_category() ) {
    		$query->set( 'orderby', 'title' );
    		$query->set( 'order', 'ASC' );
    		// $query->set( 'posts_per_page', '2' );
     
    		//* Remove the post info
    		remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
     
    		//* Remove the post thumbnail
    		remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
     
    		//* Remove the post content
    		remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
    		remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
    		remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );
     
    		//* Remove the post meta
    		remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
    		remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
    		remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
    		
    		remove_action( 'genesis_loop', 'genesis_do_loop' );
    		add_action( 'genesis_loop', 'sk_custom_loop' );
    	}
     
    }
     
    function sk_custom_loop() {
     
    	//* Use old loop hook structure if not supporting HTML5
    	if ( ! genesis_html5() ) {
    		genesis_legacy_loop();
    		return;
    	}
     
    	if ( have_posts() ) : while ( have_posts() ) : the_post();
     
    			do_action( 'genesis_before_entry' );
     
    			printf( '<article %s>', genesis_attr( 'entry' ) );
     
    				do_action( 'genesis_entry_header' );
     
    				do_action( 'genesis_before_entry_content' );
    				// printf( '<div %s>', genesis_attr( 'entry-content' ) );
    					do_action( 'genesis_entry_content' );
    				// echo '</div>'; //* end .entry-content
    				do_action( 'genesis_after_entry_content' );
     
    				do_action( 'genesis_entry_footer' );
     
    			echo '</article>';
     
    			do_action( 'genesis_after_entry' );
     
    		endwhile; //* end of one post
    		do_action( 'genesis_after_endwhile' );
     
    	else : //* if no posts exist
    		do_action( 'genesis_loop_else' );
    	endif; //* end loop
     
    }

    Next step: Try to use conditional tags to display the codes instead of having to have so many custom category id pages. Essentially, just a cleaner layout.

    April 18, 2014 at 4:03 pm in reply to: News Pro: How to Exclude Child Category Posts from Parent Category Archive #101222
    Beneaths
    Member

    Did you ever make any headway on this? I've been searching the last few days and it doesn't seem I'm alone trying to figure it out. Most articles too are simply outdated

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)

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