• 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

Need Help Displaying Manual Excerpts for Custom Post Type

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 › Need Help Displaying Manual Excerpts for Custom Post Type

This topic is: resolved
  • This topic has 6 replies, 3 voices, and was last updated 12 years, 11 months ago by mohsin.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • December 24, 2012 at 10:38 am #7261
    mohsin
    Member

    Hi,

    We are using Backcountry theme.

    I am stuck with one issue, i.e. in the archive page of the Custom-Post, auto exerpts are being shown, and not the hand-written excerpts which we have written for those CPT posts.

    Can you please guide, what could be the issue?

    Thanks,

    Mohsin

    December 24, 2012 at 12:42 pm #7295
    ryandonsullivan
    Member

    Is this a custom post type that you added manually?

    You may just need to add the 'excerpts' to the 'supports' section of your CPT array.

    For example from the WordPress codex:


    add_action( 'init', 'create_post_type' );
    function create_post_type() {
    register_post_type( 'acme_product',
    array(
    'labels' => array(
    'name' => __( 'Products' ),
    'singular_name' => __( 'Product' )
    ),
    'public' => true,
    'has_archive' => true,
    ''supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'genesis-seo' ),
    )
    );
    }

    If your code doesn't have the 'excerpt' explicitly defined then Genesis will fall back to the default auto-generated ones.

    If you're adding your custom post type with a plugin or some other way, then pretty much everything above is useless ๐Ÿ˜‰

    December 24, 2012 at 1:57 pm #7313
    mohsin
    Member

    Hi ,

    Thank you for your reply. ย Yes i am adding it manually from the functions.php file.

    I do have added that support in CPT function, and i see box in the admin panel, where we have added the custom hand crafted excerpts, our challenge is to display them at the front-end in the theme.. In the front-end , Genesis is showing auto excerpts and not checking/considering the manual excerpts before going to display the auto-excerpts.. what could be the solution to this please?

    Thank you,

    Mohsin

    December 27, 2012 at 12:25 pm #7710
    wpsmith
    Member

    You may want to check out Genesis CPT Archives plugin that may help you a bit.

    Please let me know if I can help any further.


    Travis Smith | Recommended StudioPress Developer & Contributor
    WP Smith | @wp_smith | GitHub

    Due to the forums, please paste code using Pastebin, JS Fiddle (for JavaScript) or GitHub.
    How to use Firebug for Designers by SixRevisions

    December 27, 2012 at 3:34 pm #7745
    mohsin
    Member

    Hi,

    Thank you for your response. I am not sure if plugin will help in this situation, as we have already have all CPT code in place and templates ready. Also we have other CPTs with custom stuff on their archives pages so i am little scared to use plugin at this stage as it can conflict with other stuff.

    As most of the CPT archives have auto excerpts.. so thats great... i have only issue with this one particular CPT, which have manual excerpts inside it..but not outputting it on archive pages and still showing auto-excerpts which as per wp rules should only be considered if no manual excerpts found...

    I have tried to have empty arhive tempalte file for this CPT by having only GENSIS(); inside it.. Do not know where i have messed it up or any Genesis function which may need to be filtered/changed...

    Thanks for all the support.

     

    December 27, 2012 at 3:47 pm #7747
    wpsmith
    Member

    You can try something like this on your template that you tried (it could also go into functions.php).


    remove_action( 'genesis_post_content', 'genesis_do_post_content' );
    add_action( 'genesis_post_content', 'wps_cpt_do_post_content' );
    /**
    * Custom post content for cpt archive page
    */
    function wps_cpt_do_post_content() {
    if ( is_post_type_archive( 'wps_post_type_name' ) ) // change me to your registered cpt name
    the_excerpt();
    else
    genesis_do_post_content();
    }


    Travis Smith | Recommended StudioPress Developer & Contributor
    WP Smith | @wp_smith | GitHub

    Due to the forums, please paste code using Pastebin, JS Fiddle (for JavaScript) or GitHub.
    How to use Firebug for Designers by SixRevisions

    December 27, 2012 at 3:58 pm #7749
    mohsin
    Member

    Hi Travis,

    Wow this worked. Thank you so much for your help. ๐Ÿ™‚

    Thank you @WP_Smith for your time and help.

    Regards,

    Mohsin

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