Decor: Remove featured image but not styled date

Community Forums Forums Design Tips and Tricks Decor: Remove featured image but not styled date

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 1 year, 1 month ago.

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

    Deluxe Designs
    Participant
    Post count: 3

    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.

    #28445

    braddalton
    Participant
    Post count: 7467
    /** 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.


    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

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

You must be logged in to reply to this topic.