• Using Twenty Fourteen I see how setting a post as “Featured” will add it to the grid, however a featured image must be set for the image to display in the grid. If I set a featured image this image will show up twice in the post itself.

    How can I have the first image from the Featured post show up in the grid automatically, or how can I set a featured image for a post that is also Featured and not have it show up twice in the post? Or is there a better way to handle this? Thanks.

Viewing 1 replies (of 1 total)
  • Hi,

    “How can I have the first image from the Featured post show up in the grid automatically?”

    There have many plugin can solve this problem. Personally i never try any auto generate first image plugin but maybe you can try this plugin.

    https://wordpress.org/plugins/auto-post-thumbnail/

    or maybe you can try add this code in your functions.php file. Don’t know this code work or not because never try it, maybe you can tell if this code work.

    function autoset_featured( $new_status, $old_status, $post ) {
              if( $new_status != 'publish' ) return;
              $already_has_thumb = has_post_thumbnail($post->ID);
                  if (!$already_has_thumb)  {
                  $attached_image = get_children( "post_parent=$post->ID&post_type=attachment&post_mime_type=image&numberposts=1" );
                              if ($attached_image) {
                                    foreach ($attached_image as $attachment_id => $attachment) {
                                    set_post_thumbnail($post->ID, $attachment_id);
                                    }
                               }
                            }
          }
    add_action( 'transition_post_status', 'autoset_featured', 10, 3 );

    “How can I set a featured image for a post that is also Featured and not have it show up twice in the post”

    If the first question problem solved, maybe you will have problem in this second question. And i still searching the answer. But for right now, i edit manually each post because my blog only have 100 post to edit. And the best thing is, i can choose better and bigger featured image for future theme if i change my theme again.

    I hope there have better solution to solve this problem.

    Sincerely,
    [sig moderated as per the Forum Rules]

Viewing 1 replies (of 1 total)
  • The topic ‘Grid, Featured & Featured Image confusion’ is closed to new replies.