Forum Replies Created
-
AuthorPosts
-
October 29, 2020 at 9:58 am in reply to: Failed Migration from Atomic Blocks to Genesis Blocks #501656MatthewParticipant
Thanks, I am now using 1.1.1 and the problem has gone away. The migration has completed.
MatthewParticipantThanks, Summer, that's working nicely.
MatthewParticipantOK, I'm stumped and could do with some more help...
To recap...
- - I'm using the Streamline Pro theme.
- - If I've attached a featured image, I want it to be shown at the top of the post.
- - If I haven't attached a featured image, I don't want an image to be shown there (and I especially don't want a random image from within the post to be treated as if it's a 'featured image'.
The theme uses this code to show an image for the post.
//* Remove default post image remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 ); //* Add post image above post title add_action( 'genesis_entry_header', 'streamline_post_image', 1 ); function streamline_post_image() { if ( is_page() || ! genesis_get_option( 'content_archive_thumbnail' ) ) return; if ( $image = genesis_get_image( array( 'format' => 'url', 'size' => genesis_get_option( 'image_size' ) ) ) ) { printf( '<a href="%s" rel="bookmark"><img class="post-photo" src="%s" alt="%s" /></a>', get_permalink(), $image, the_title_attribute( 'echo=0' ) ); } }
I've taken the code by Gary Jones...
add_filter( 'genesis_get_image', 'prefix_stop_auto_featured_image' ); /** * Stop Genesis archives from using first attached image as fallback when no featured image is set. * * @param array $args Default image arguments. * * @return array Amended default image arguments. */ function prefix_stop_auto_featured_image( $args ) { if ( ! isset( $args['context'] ) || 'archive' !== $args['context'] ) return $args; $args['fallback'] = false; return $args; }
... and placed it in the functions.php file before the code that came with the theme. That didn't work, so I modified Gary's code in several ways, none of which worked.
I'm exhausted! Help!!!
MatthewParticipantHi, Summer,
Thanks for pointing me in the direction of that thread. It discusses exactly the problem I'm having.
My first attempt to use the code snippet from GitHub didn't work properly. I'll take another look tomorrow.
MatthewParticipantAnyone?
MatthewParticipantI'll try to make my question clearer. I'm not wanting to reposition the featured image.
- I have a post with a featured image.
- The featured image is shown with the post.
- I remove the featured image.
- The featured image is still shown with the post.
My question is, why is the featured image still displayed when it is no longer associated with the post?
MatthewParticipantBrad, I do want the featured image to be displayed if it is there.
MatthewParticipantWould like to know how this can be done. Please share the answer when you've got it.
-
AuthorPosts