• 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

Streamline Theme – Questions on "featured image"

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 › General Discussion › Streamline Theme – Questions on "featured image"

This topic is: not resolved

Tagged: featured image, streamline

  • This topic has 15 replies, 2 voices, and was last updated 12 years, 2 months ago by ludvig.
Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • August 17, 2013 at 12:25 pm #57060
    ludvig
    Member

    Hey,

    I was wondering whether the "featured image", that originally comes with the theme and is placed above posts, can be customized to show on specific posts rather than on ALL posts or NO posts.

    Currently I have disabled it due to it giving me trouble with my old posts; giving rise to duplicate pictures and adding to that that my old blog posts pictures are in terrible resolution and do not look good in the format of the featured image.
    (There is an option to disable the duplicate pictures in the theme options, but I have crossed that box and it is still giving me issues on a few posts)

    Now I think the "featured image" of Streamline looks great, but only when done correctly. It looks awful on my old posts. What I would like to do is to disable it for all old posts, but add it to my new posts and select images that look nice in that format.

    So, is this possible to do; can I adjust for the "featured image" function above the posts to be customized per post?

    http://www.startgainingmomentum.com
    August 17, 2013 at 12:44 pm #57061
    Brad Dalton
    Participant

    Yes you can add conditional tags with an array of page/post i.d's after the function to the PHP code in your child themes functions.php file.

    Or change the conditional in this code in your functions file.

    Or you can use CSS code:

    .home  .post-image { 
    display: none; 
    }
    

    View the source code to find the post/page i.d in the body class.

    Nite these code snippets are samples and would need to be customized to your needs.


    Tutorials for StudioPress Themes.

    August 17, 2013 at 12:46 pm #57063
    ludvig
    Member

    Wow, thanks a lot for the quick answer Brad!

    I'll post again if I get a problem.

    August 20, 2013 at 12:24 pm #57613
    ludvig
    Member

    Hey again,

    I've been trying to get it working, but I'm having some trouble. I've only been toying with CSS & PHP files for two weeks and barely understand how to structure it.

    Question:

    1.Do I need to collect every PageID and insert manually into the code? (Because none of my old posts fit the format for the featured above picture and would therefore not look well with it)

    2. Once having collected these PageIDs (not the hard part), WHERE and HOW do I put them into the PHP, could you post an example? When I say how, what I'm really asking is how to separate the IDs and how to "finish" the code.
    Would it be like this?

    /** Add post image above post title */
    add_action( 'genesis_before_post', 'streamline_post_image' );
    function streamline_post_image() {

    if ( pageID1, pageID2, PageID3, etc...() ) return;

    if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
    printf( '', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    }

    }

    August 20, 2013 at 12:49 pm #57623
    Brad Dalton
    Participant

    You add an array:

    Or you can tag them and add the conditional tag

    if ( has_tag( 'brads-tag' )  ) return;

    Tutorials for StudioPress Themes.

    August 20, 2013 at 1:34 pm #57644
    ludvig
    Member

    The issue has now been resolved, though it took some time to manually look up and write all the IDs.

    I want to note for future readers that in my case it had to be is single not is page, because all of my old blog posts that look horrible with the Streamline featured image function were single posts.

    Thanks a lot Brad,
    I will likely post a few more questions in the coming days and weeks seeing as how I have so much to learn and so much to do until I am content with the appearance of my blog. I hope they too will be answered as quickly and skillfully!

    🙂

    August 20, 2013 at 2:03 pm #57659
    ludvig
    Member

    Actually I was wrong, the issue is not entirely resolved.

    I only fixed it INSIDE the posts by doing that. So now I got 50 % of the problem solved.

    http://www.startgainingmomentum.com/
    If you take a look at my blog you'll note that on the home/front page it looks bad with the featured pictures. But inside the posts it looks as it should.

    I already got the correct array and combinations of IDs, I just need to understand which code to use so that I can remove the same combination of featured images from my front page.

    I've tried a bunch of different variations, including is_home and is_front_page but I am coming up short for the moment.

    Any thoughts of what I can do?

    August 20, 2013 at 3:05 pm #57720
    Brad Dalton
    Participant

    Use CSS code instead.

    .home .post-image { 
    display: none; 
    }
    

    Tutorials for StudioPress Themes.

    August 21, 2013 at 9:07 am #57922
    ludvig
    Member

    I've been trying to use the CSS code (and checked out your post on it on your blog) and yeah it works, but it effectively eliminates ALL the featured images in the posts shown on my home page/ blog template.

    And I do not want to completely eliminate it, I only want it to be hidden from the "ugly", old images, that I have in my previous blog posts. I want to keep the featured pictures showing in the home page/blog template for all the new posts I make.

    Thus far I have been able to eliminate the featured images inside the posts by using the ".single (array( post id)" command that you showed me.

    But those ugly featured images are still showing on the home page/blog template.

    Is there no way to customize it on the home page/blog template in the exact same manner that I've been able to do with the posts?

    Perhaps I am misunderstanding this, I am very new to PHP/CSS.

    August 21, 2013 at 3:49 pm #58033
    Brad Dalton
    Participant

    You can use the remove action in a custom function:

    You will need to change the conditional tag.


    Tutorials for StudioPress Themes.

    August 22, 2013 at 1:17 pm #58253
    ludvig
    Member

    Thanks for being persistent in helping me Brad, but I am a hardcase at this stuff 🙂

    I am having trouble understanding how I am supposed to change the conditional tags appropriately.. I managed to do it the last time but this is proving a bit difficult.

    Here is how the code looks for my previous PHP that was successful in removing the featured image from inside the posts:

    /** Add post image above post title */
    add_action( 'genesis_before_post', 'streamline_post_image' );
    function streamline_post_image() {

    if ( is_single( array( 140, 145, 154, 91, 160, 161, 162, 173, 180, 206, 194, 213, 239, 291, 312, 323, 333, 382, 424, 493, 516, 562, 622, 659, 684, 717, 752, 791, 750, 816, 847, 862, 884, 889, 950, 969, 1030, 1015, 1057, 1086, 1105, 1159, 1185, 1228, 1246, 1257, 1263, 1295 ) ) ) return;
    if ( is_page ( 28 ) ) return;

    if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
    printf( '%s', get_permalink(), $image, the_title_attribute( 'echo=0' ) );
    }

    }

    How would I go about adjusting the new code you suggested?
    Here is how I have written it right now just under the section above , but it is obviously completely wrong as it crashes my page:

    add_action('genesis_post_content', 'remove_featured_image_single');
    function remove_featured_image_single() {
    if(is_single( 140, 145, 154, 91, 160, 161, 162, 173, 180, 206, 194, 213, 239, 291, 312, 323, 333, 382, 424, 493, 516, 562, 622, 659, 684, 717, 752, 791, 750, 816, 847, 862, 884, 889, 950, 969, 1030, 1015, 1057, 1086, 1105, 1159, 1185, 1228, 1246, 1257, 1263, 1295 ) ) {
    remove_action( 'genesis_post_content', 'genesis_do_post_image' );

    }

    }

    I basically just replaced where you had category to what had worked in the code above for me seeing as how there are many posts that need to be adjusted and the issue is non-category specific,. But it didn't work. I am messing up the code because I don't really understand how to write it properly yet.

    August 22, 2013 at 1:43 pm #58256
    ludvig
    Member

    It no longer crashes my page when I changed it to:

    add_action('genesis_post_content', 'remove_featured_image_specific_category');
    function remove_featured_image_specific_category() {
    if( is_single( array( 140, 145, 154, 91, 160, 161, 162, 173, 180, 206, 194, 213, 239, 291, 312, 323, 333, 382, 424, 493, 516, 562, 622, 659, 684, 717, 752, 791, 750, 816, 847, 862, 884, 889, 950, 969, 1030, 1015, 1057, 1086, 1105, 1159, 1185, 1228, 1246, 1257, 1263, 1295 ) ) ) {
    remove_action( 'genesis_post_content', 'genesis_do_post_image' );

    }

    }

    But it produces no effect

    August 22, 2013 at 3:34 pm #58281
    Brad Dalton
    Participant

    I don't think this hook will work on the home page, only on posts.

    genesis_post_content
    

    Tutorials for StudioPress Themes.

    August 23, 2013 at 1:23 pm #58475
    ludvig
    Member

    Hm.. Ok.

    Damn, I can't believe no one else has had to before to solve this problem. I've been searching a lot for how other people have solved this, but I can't find anyone.

    All posts I find are only about hiding posts using categories.

    I'll keep searching and update if I find something.

    In the meantime I will inactivate the feature picture command.

    August 23, 2013 at 2:21 pm #58510
    Brad Dalton
    Participant

    Most people use CSS however i believe its simply a matter of changing the hook. I will work this out when i have time.


    Tutorials for StudioPress Themes.

    August 24, 2013 at 12:35 pm #58607
    ludvig
    Member

    I see.

    Cool. I really appreciate you taking time to help me.

  • Author
    Posts
Viewing 16 posts - 1 through 16 (of 16 total)
  • The forum ‘General Discussion’ 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