Filter post types to change output

Community Forums Forums General Discussion Filter post types to change output

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  khcreativemedia 2 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4941

    khcreativemedia
    Participant
    Post count: 6

    Hey guys,

    I have a site that uses custom post types. My intent is to have the custom post types show the full content (the_content) instead of the excerpt on the home page, while the regular post type shows the the excerpt. Here is my code that is currently being use to display all post types on the home page:

    remove_action(‘genesis_loop’, ‘genesis_do_loop’); // Remove default loop
    add_action(‘genesis_loop’, ‘custom_do_cat_loop’); // Execute custom loop
    function custom_do_cat_loop() {
    global $query_args, $paged;  // any wp_query() args
    $args = array(‘post_type’ => array( ‘post’, ‘schedule’, ‘news’, ‘quote’, ‘recommendation’ ),
    ‘paged’ => $paged );
    genesis_custom_loop(wp_parse_args($query_args, $args));
    }
    Can anyone tell me what I would need to add to accomplish my goal?

    http://www.fuelingnewbusiness.com

    Thanks,
    Keith

    #5096

    Jen Baumann
    Keymaster
    Post count: 444

    Are you using different sections of content? If so, then it would be easier just to create widget areas and use http://wordpress.org/extend/plugins/genesis-featured-widget-amplified/


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #5205

    khcreativemedia
    Participant
    Post count: 6

    No, these post will flow in within the rest of the posts. So I need them to be filtered somehow so that regular post pull the except and cpt pull the content. Make sense?

    Thanks Jen,

    Keith

    #5206

    Jen Baumann
    Keymaster
    Post count: 444

    You could do something like this, targeted just to the post types that you want to do full content (inside conditionals). Of, course, if I understand you correctly

    /** Removes everything form post content **/
    remove_all_actions( 'genesis_post_content' );
    /** Add your custom content **/
    add_action( 'genesis_post_content', 'custom_post_content' );
    function custom_post_content() {
    the_content();
    }


    If you need technical support for your theme please file a ticket.

    The forums are community based. Staff only monitors the forum for issues relating to the forum itself and to redirect users to where they need to go.

    #5207

    khcreativemedia
    Participant
    Post count: 6

    Makes sense. I’ll give it a shot. thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.