Community Forums › Forums › Archived Forums › Design Tips and Tricks › change featured post image width
- This topic has 12 replies, 2 voices, and was last updated 10 years, 5 months ago by Brad Dalton.
-
AuthorPosts
-
October 20, 2013 at 8:55 pm #67928dmcleod87Member
hi,
i have added the below code to my website yet some of the featured post images don't display at full size (800px wide)
/** Add Featured Image Above Post Content on Posts */ add_action( 'genesis_entry_header', 'single_post_featured_image', 15 ); function single_post_featured_image() { if ( ! is_singular( 'post' ) ) return; $img = genesis_get_image( array( 'format' => 'html', 'size' => genesis_get_option( 'image_size' ), 'attr' => array( 'class' => 'post-image' ) ) ); printf( '<a href="%s" title="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), $img ); }
the featured image on the post below is meant to be 800px wide but displays as 673px. what do i need to edit in order to make them display at 800px?
thanks in advance!
http://influencer.dylanmcleod.net.au/uncategorized/instagram-giveaway-pattern-100-fashion-designers-10-curators-book/October 20, 2013 at 10:34 pm #67938Brad DaltonParticipantWhats the original size of the image?
Its always best to make sure the images are the correct size before adding them as featured images.
There are many tools which enable you to do this like GIMP, Adobe Photoshop and Paint.net for Windows.
October 20, 2013 at 10:45 pm #67939dmcleod87Memberthe original size of the image is 800px. it's odd that some which are also 800px wide display at 800px wide, just not some. all post images are 800px when uploaded...
October 20, 2013 at 10:46 pm #67940dmcleod87Memberfor example this posts featured image is displaying correctly and is the same width as the other-
http://influencer.dylanmcleod.net.au/featured-three/street-smith-x-basically-boutique/
October 20, 2013 at 10:55 pm #67941Brad DaltonParticipantOctober 20, 2013 at 11:23 pm #67946dmcleod87Memberyeah i noticed that before but i assure you the image i uploaded is 800px and the filename is meant to be pattern1.jpg. it seems to be linking to 'full size' image setting but i just re-uploaded the photo as the featured image and still links to that file.
i've deleted the post altogether as well as the images and re-created it and still it links to the smaller image. when i choose the featured image in the post i don't get to choose the size eg thumbnail, small, medium large etc...
i think i'm having issues because i've imported all the posts/images from blogger and the posts are a mess.
October 20, 2013 at 11:29 pm #67948dmcleod87Memberjust an update. have swapped the featured images and it works fine. very odd.
thanks for your help anyway brad.
October 21, 2013 at 12:15 am #67955dmcleod87Memberspoke too soon. added a few new posts and had no issues, now i've added another post and again the featured image automatically reverts to a smaller size. i tried a different featured image, yet it didn't work as it did for the last post mentioned above.
really stumped with this one!
October 21, 2013 at 1:25 am #67962Brad DaltonParticipantIts hard for me to test because i don't have a copy of your theme.
You could add a new size to your functions.php file however the images are different heights aren't they?
October 21, 2013 at 1:33 am #67964dmcleod87Memberyeah i've been reading through these pages-
http://codex.wordpress.org/Function_Reference/add_image_size
http://codex.wordpress.org/Post_Thumbnailsthis is their example-
add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height)
if ( function_exists( 'add_image_size' ) ) { add_image_size( 'category-thumb', 300, 9999 ); //300 pixels wide (and unlimited height) add_image_size( 'homepage-thumb', 220, 180, true ); //(cropped) }
i could declare a new image size and set the image to 800 wide and 9999 for the height...do you think that would work? after i regenerate thumbnails first of course...
October 21, 2013 at 1:38 am #67965dmcleod87Memberonly problem is how do i choose this when i add the featured image in the post when i can't select an option? or do i declare that in the code somehow?
October 21, 2013 at 2:54 am #67971dmcleod87Memberfound a fix. i changed the content archive settings in theme settings. the featured image size was set to 'large (1024x1024px). after declaring the new image size and regenerating the thumbnails, i went back and chose 'post-image (800x9999px) and they all display fine now.
thanks again for the assistance brad, much appreciated!
October 21, 2013 at 3:29 am #67976Brad DaltonParticipantThat's it. No worries.
//* Add new image sizes add_image_size( 'post-image', 800, 9999, TRUE );
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.