• 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

Decor: Remove featured image but not styled date

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 › Decor: Remove featured image but not styled date

This topic is: not resolved

Tagged: decor, featured image

  • This topic has 1 reply, 2 voices, and was last updated 10 years ago by Brad Dalton.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • March 14, 2013 at 8:54 am #26178
    Deluxe Designs
    Member

    I am using Decor and would like to remove the featured image but NOT the styled date. In the functions file, there is a code that I can remove that will delete the featured image but it also removes the styled date, which I do not want. I am looking for the part of the code to KEEP the styled date.

    The site I am working on is: http://www.deluxe-designs.net/Lee
    Thank you.

    March 16, 2013 at 10:56 pm #28445
    Brad Dalton
    Participant
    /** Add post image above post title */
    add_action( 'genesis_before_post_title', 'decor_post_image' );
    function decor_post_image() {
    
    	if ( is_page() ) return;
    
    	if ( $image = genesis_get_image( 'format=url&size=post-image' ) ) {
    		printf( '<a href="%s" rel="bookmark" class="post-photo"><span class="post-date">%s</span><img src="%s" alt="%s" /></a>', get_permalink(), do_shortcode( '<em>[post_date format="j"]</em>[post_date format="F Y"]' ), $image, the_title_attribute( 'echo=0' ) );
    	}
    
    }
    

    Delete this function and use the next custom function in the file to add your post date using the CSS class for the .post-date.

    You'll also see a block of code in functions like this:

    /** Customize the post info function */
    add_filter( 'genesis_post_info', 'post_info_filter' );
    function post_info_filter( $post_info ) {
    	if ( !is_page() ) {
    			$post_info = __( 'posted by', 'decor' ) . ' [post_author_posts_link] [post_comments] [post_edit]';
    			return $post_info;
    	}
    }
    

    You can use this as a guide on how to customize your post info keeping in mind the post date has a class and therefore contains CSS code already in the style sheet.

    I know this is not a complete solution because you will need a custom function written to do what you want.
    http://my.studiopress.com/snippets/post-info/

    Here's some of the CSS you'll find in your style.css file which uses the class .post-date for styling. This class is removed when you delete the decor_post_image function therefore the styling will no longer work.

    There is more so you can see its a bit of work:

    .post-date {
    	-moz-box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.20);
    	-webkit-box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.20);
    	background-color: #fff;
    	box-shadow: 0px 3px 4px rgba(0, 0, 0, 0.20);
    	color: #7d7d7d;
    	display: block;
    	font-size: 14px;
    	padding: 20px 10px;
    	position: absolute;
    	right: 20px;
    	text-align: center;
    	top: -2px;
    	width: 100px;
    	z-index: 999;
    }
    
    .post-date em {
    	color: #b88e52;
    	display: block;
    	font-family: 'Great Vibes', cursive;
    	font-size: 55px;
    	line-height: 55px;
    }
    
    .post-photo:hover .post-date em {
    	color: #7d7d7d;
    }
    

    I used Notepad++ to search and find all CSS code in the Decor child themes style.css file relating to the post-date class.


    Tutorials for StudioPress Themes.

  • 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