Display post excerpts for blog only; not archive pages

Community Forums Forums Design Tips and Tricks Display post excerpts for blog only; not archive pages

This topic is: resolved

This topic contains 6 replies, has 2 voices, and was last updated by  braddalton 2 months, 1 week ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #109400

    jodzeee
    Participant
    Post count: 216

    I’ve got my blog set up using the “blog” template, but I also want to have pages that show posts from another category. I assume that using an archive/category page is the way to go? If so, I would like the full content to show on the category pages, but only the excerpt on the blog page.

    I have poked around and found some snippets, but haven’t been able to get anything to work.

    Here’s the site:

    http://www.awake-in-life.uncorkeddesign.com/

    Learn More > Latest News is one of the category pages I’m referring to.

    #109407

    braddalton
    Participant
    Post count: 9212

    You could do this from your functions file or make a custom template for your blog page

    Then use the SP snippets


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #109414

    jodzeee
    Participant
    Post count: 216

    I don’t think I worded my question right. I want to show all content on archive pages and excerpts only on the blog page.

    I finally figured it out.

    add_action( 'genesis_before_loop', 'sk_excerpts_blog_page' );
    function sk_excerpts_blog_page() {
      if ( is_page_template( 'page_blog.php' ) ) {
    		add_filter( 'genesis_pre_get_option_content_archive', 'sk_show_excerpts' );
    	}
    }
    function sk_show_excerpts() {
    	return 'excerpts';
    }
    #109437

    braddalton
    Participant
    Post count: 9212

    You did and that what my solution provides a custom blog page template.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #109442

    braddalton
    Participant
    Post count: 9212
    #109495

    jodzeee
    Participant
    Post count: 216

    Thanks, now I understand what you were getting at. Is there an advantage to doing it that way versus the way I did it above?

    #109512

    braddalton
    Participant
    Post count: 9212

    More efficient plus you can customize your blog page template without effecting other archives and add content before the loop in the blog page only.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

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

You must be logged in to reply to this topic.