• 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 full posts on blog page, excerpts on categories (Swank theme)

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 full posts on blog page, excerpts on categories (Swank theme)

This topic is: resolved

Tagged: featured post, post excerpt

  • This topic has 1 reply, 1 voice, and was last updated 8 years, 4 months ago by eef.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • January 27, 2015 at 12:02 pm #138775
    eef
    Member

    Working on Swank and trying to show full posts on the blog, but excerpts with featured image on the category pages... gotten a little stuck!

    I created a category page template:

    <?php
     
    add_filter( 'body_class', 'category_page_body_class' );
    function category_page_body_class( $classes ) {
    $classes[] = 'custom-category';
    return $classes;
    }
    
    remove_action( 'genesis_loop', 'genesis_do_loop' );  
    add_action('genesis_loop', 'genesis_standard_loop', 5);
     
    add_filter( 'genesis_pre_get_option_content_archive', 'category_page_excerpts' );
     
    function category_page_excerpts( $opt ) {
    return 'excerpts';
    }
     
    
    genesis();

    But I want to display the featured post image to the left. How do I add that in?

    Category page: http://eef-dev.com/emily/category/engagements/

    Thanks!

    http://eef-dev.com/emily/blog/
    January 27, 2015 at 5:47 pm #138802
    eef
    Member

    Okay, here's what I did, though not sure it's the best solution. This causes the blog pages to show full posts and no feature-image thumbnail, but the category pages to show the featured image and just an excerpt.

    Genesis theme settings:
    Display post content
    Include featured image (align left)

    functions.php:

    //* Remove featured post thumbnail
    remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );

    category.php:

    <?php
     
    add_filter( 'body_class', 'category_page_body_class' );
    function category_page_body_class( $classes ) {
    $classes[] = 'custom-category';
    return $classes;
    }
    
    remove_action( 'genesis_loop', 'genesis_do_loop' );  
    add_action('genesis_loop', 'genesis_standard_loop', 5);
     
    add_filter( 'genesis_pre_get_option_content_archive', 'category_page_excerpts' );
     
    function category_page_excerpts( $opt ) {
    return 'excerpts';
    }
    
    add_action( 'genesis_entry_content', 'genesis_do_post_image', 9 );
    
    genesis();
    

    If anyone has a better solution, let me know. Otherwise I hope this helps someone else!

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

© 2023 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