• 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

Create a custom category page

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 › Create a custom category page

This topic is: not resolved
  • This topic has 7 replies, 2 voices, and was last updated 12 years, 3 months ago by Peter.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • February 11, 2013 at 3:21 pm #19692
    treoguy
    Member

    I have a category on my website that is for tips. When someone clicks on the menu link, I get a list of tips in chronological order. I would like to customize this page so that I can place some of the more popular tips formatted in specific groups. Below this list would be the standard listing of tips along with pagination to continue through the tips.

    Any suggestions on where to start?

    February 11, 2013 at 5:22 pm #19721
    Peter
    Member

    I'd probably create an extra category like "hot tips" and create a custom page for the tips category. Just before the main loop on the tips category page I would add a custom loop for items in the "hot tips" category. You could also modify the main loop not to display items in the hot tips category so you don't get them appearing in both lists.. if that makes sense..

    February 11, 2013 at 5:48 pm #19724
    treoguy
    Member

    Thanks Peter.

    I was thinking to code the top of the page with HTML and then have the category content output below.

    Any suggestions on tutorials for creating this custom page and applying it to a category. If I can get my feet wet creating one of these pages, that would be a good start, might give me more ideas on the application.

    February 11, 2013 at 6:06 pm #19726
    Peter
    Member

    I'm not sure of there are any "official" tutorials on this but there's one from Brian about creating a page to display a single category.. it's not exactly what I meant but could be a good place to start;

    http://www.briangardner.com/blog-page-single-category/

    February 11, 2013 at 6:26 pm #19735
    treoguy
    Member

    I had seen that, but it's not of any help, at least for what I'm hoping to accomplish.

    Ultimately, I want to create a custom template that I'll be able to use for a specific category (ie. tips).

    At the top, I'll be able to include my custom HTML so I can make it an appealing landing page. Sort of like a table of contents.

     

    So when someone hits the TIPS page, they get:

    CUSTOM HTML

    --------------------

    Regularly updated articles from this category

    Pagination to continue to through to other articles in category

     

    I'm sure this has been done, but not sure I'm doing a great job of communicating my goal for the page.

    February 11, 2013 at 6:35 pm #19736
    Peter
    Member

    I see what you mean..

    I'm finishing for the night now but if you haven't got this sorted by tomorrow I will post up some code for you..

    Thanks,

    Peter

    February 11, 2013 at 6:39 pm #19738
    treoguy
    Member

    That would be great. Thanks!

    February 12, 2013 at 12:17 pm #19850
    Peter
    Member

    There are lots of ways of doing it but this one might work for you. It used the "genesis_after_endwhile" hook to display the latest posts from a specific category after the page content.

    Create a new page template in your child theme folder and drop this code into it, replace "Category Name" with the name of your category;

    /*
    Template Name: Category Name
    */
    
    add_action( 'genesis_after_endwhile', 'display_custom_category' );
    function display_custom_category() {
    	$category_id = get_cat_ID( 'Category Name' );
    	$category_link = get_category_link( $category_id );
    	$args = array( 'numberposts' => 5, 'category' => $category_id );
    	$myposts = get_posts( $args );
    	if ( $myposts ) {
    		?>
    		<div class="custom-category">
    			<h4>Regularly updated articles from Category Name</h4>
    			<ul>
    			<?php
    			foreach ( $myposts as $mypost ) {
    				echo '<li><a href="' . get_permalink( $mypost->ID ) . '" title="' . $mypost->post_title . '">' . $mypost->post_title . '</a></li>';
    			}
    			?>
    			</ul>
    			<p><a href="<?php echo esc_url( $category_link ); ?>" title="Category Name">Read more articles in Category Name</a></p>
    		</div><!-- /custom-category -->
    	<?php
    	}// end if
    }
    
    genesis();

    When you view a page using this page template you should see the normal page content followed by the latest posts from the category you specified in the template followed by a link to the category page.

    It's rough and ready and there's no paging or anything but it might be enough to get you going 🙂

    More info on the get_posts function at: http://codex.wordpress.org/Function_Reference/get_posts

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 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

© 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