Excerpts on some pages / full posts on others

Community Forums Forums Design Tips and Tricks Excerpts on some pages / full posts on others

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  nickthegeek 2 years ago.

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

    chaoscontrol
    Participant

    I’d like to have most pages that list posts (search results, by tag, etc) display excerpts, but have a ‘blog’ page that displays full posts.  What is the best way to override the general site settings for this on a particular page? I know that I could create a custom WordPress query, but am wondering if there is an easier, Genesis-specific way of doing it?

    #1794

    nickthegeek
    Keymaster
    Post count: 756

    There are a few ways to do this. One solution is to use a custom conditional action like


    add_action( 'genesis_before', 'child_conditional_actions' );
    function child_conditional_actions() {
    if( is_page_template('page_blog.php') ) {
    remove_action( 'genesis_post_content', 'genesis_do_post_content' )
    remove_action( 'genesis_post_content', 'genesis_do_post_image' );
    add_action( 'genesis_post_content', 'the_content' );
    }
    }

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

You must be logged in to reply to this topic.