Homepage › Community Forums › Ambition › Logo not showing on mobile › Reply To: Logo not showing on mobile
“How do I remove a featured image from my pages but not my posts? My images are displaying twice on my pages and I have no ability to edit the placement of the one showing up as ‘featured’.”
It sounds like you’re using the Featured Image and a Post image at the same time. You would need to either remove the Featured Image, or remove the Post image (from inside your content) and it will appear just like the demo.
Just so you know, there was a small update made to the Featured Image code/section in the functions.php file in your theme. You may or may not already have this update (not sure since I can’t see your functions file.)
Just in case you don’t have the udpate, here’s the code that needs to be changed (old version) –
//* Add featured image above the entry content
add_action( 'genesis_entry_header', 'ambition_featured_photo', 5 );
function ambition_featured_photo() {
if ( is_attachment() || ! genesis_get_option( 'content_archive_thumbnail' ) )
return;
if ( is_singular() && $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'image_size' ) ) ) ) {
printf( '<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', $image, the_title_attribute( 'echo=0' ) );
}
}
Replace that code with the new updated version –
// Add featured image above the entry content
add_action( 'genesis_before_entry', 'ambition_featured_photo' );
function ambition_featured_photo() {
if ( ! ( is_singular() && has_post_thumbnail() ) ) {
return;
}
$image = genesis_get_image( 'format=url&size=single-posts' );
$thumb_id = get_post_thumbnail_id( get_the_ID() );
$alt = get_post_meta( $thumb_id, '_wp_attachment_image_alt', true );
if ( '' == $alt ) {
$alt = the_title_attribute( 'echo=0' );
}
printf( '<div class="featured-image"><img src="%s" alt="%s" class="entry-image"/></div>', esc_url( $image ), $alt );
}
That fixes issues for some users having trouble deleting Featured Images that wouldn’t go away. This should already be included in the latest version as I’ve used it myself.
“Also, still am unclear about how to patch the front-page.php file above. I know how to access this file, but is there a new line of code to stick in there? How exactly do I replace the old with the new? “
What @Jessy is saying is to replace the entire file itself with the new version. There was much more than one line changed so it would be easier to just replace the whole file with the new version since it would be much faster rather than going through making adjustments to each and every line. This is assuming you haven’t edited this file of course. You can swap it out using FTP (Recommended Method), or Copy/Paste the new file into the old one if you’re using the WP admin.
I create awesome sites for awesome people! Contact me if interested – ericsanchez1585@gmail.com
