• 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

Display excerpts for specific CPT archives

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 › Display excerpts for specific CPT archives

This topic is: not resolved

Tagged: CPT, custom, excerpts

  • This topic has 4 replies, 2 voices, and was last updated 11 years, 7 months ago by robkhoo.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • November 24, 2013 at 12:44 am #75332
    robkhoo
    Member

    Hi guys,

    Wondered if anybody could help out.

    My website currently displays a content limit of 300 characters on all of my archive pages.
    Whereas this is fine for blog archives, I would like something different for my job and classified archives. The jobs CPT is "jobs" and classifieds is "classifieds". I'd like to have it so that if an excerpt exists, for the archive to pull that rather than the default content limit.

    Any tips or ideas here would be fantastic!

    Thanks

    Robert

    http://nagoya-info.com
    November 24, 2013 at 1:11 am #75334
    Brad Dalton
    Participant

    If you look in the News Pro themes front page template you'll see code which you can use in your CPT archive template and modify.


    Tutorials for StudioPress Themes.

    November 24, 2013 at 1:55 am #75335
    robkhoo
    Member

    Hi Brad,
    Unfortunately I don't have the NewsPro theme. Do you mean to get it from the source code on the theme demo page?

    Thanks

    November 25, 2013 at 3:13 pm #75572
    Brad Dalton
    Participant

    You could also use PHP code to control the limit for a CPT. http://my.studiopress.com/snippets/post-excerpts/

    Then add a conditional tag after the function:

    add_filter( 'excerpt_length', 'sp_excerpt_length' );
    function sp_excerpt_length( $length ) {
    if ( is_post_type_archive( 'portfolio' ) ) {
    	return 50; // pull first 50 words
    }}
    

    Untested. Change portfolio to the name of your CPT.


    Tutorials for StudioPress Themes.

    November 25, 2013 at 4:44 pm #75586
    robkhoo
    Member

    Hi again Brad,

    Thanks for the reply.

    Ok, I think I'm starting to understand a little more about how the functions and actions work.
    I'll give this a try and let you know how it goes.

    Thanks again.

    Rob

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