Home › Forums › Winning Agent Pro Theme › Increase width of a featured image
- This topic has 12 replies, 4 voices, and was last updated 7 years, 5 months ago by
Ginger Coolidge.
- AuthorPosts
- June 30, 2014 at 4:37 pm #3211
Tuler
ParticipantHow can I increase the width of a featured image at the top of the page? I’ve increase the width of a full width page to 1080px and I’d like the featured image to be the same width.
- June 30, 2014 at 5:00 pm #3215
Ginger Coolidge
ParticipantHi there, can you share a link to one of the pages?
- June 30, 2014 at 5:21 pm #3216
Tuler
ParticipantHere’s a link to a page that has a featured image, but it’s only 740px wide where as the content is 1040px wide.
http://winsimply.com/dcranch/buyers/
- June 30, 2014 at 6:10 pm #3217
Ginger Coolidge
ParticipantThanks for the link! I see your other Call-to-Action has a full width picture inserted in the content vs a feature image here, can that work for you?
http://winsimply.com/dcranch/dc-ranch-community/
- June 30, 2014 at 6:17 pm #3218
Tuler
ParticipantNo, because I need to set feature images for items that show up on the home page.
- June 30, 2014 at 6:34 pm #3219
Tuler
ParticipantFrom what I’ve tested, there’s no way to get the home page to display the image that I place in the post.
- July 6, 2014 at 5:44 pm #3257
Ginger Coolidge
ParticipantHi there,
Sorry for the delay. I noticed you’ve added back the sidebar on your buyers page. BTW, your site is looking sharp! If you decided to make it full width again there are a few ways to accomplish this based on what you had previously.
Make a change in functions.php to:
1. Update the existing featured image conditional code to make the buyers page not use featured image for the content, but still use the featured image for the home page. This would allow you to place a full width image in the content.
Or
2. Register a new image size using the full-width dimension value that exists. Then, update the existing featured image conditional code to show this new image size instead of the regular image size on full-width pages or specifically the buyers page.
I can suggest some code snippets if you’d like to use either of these suggestions.
Best Regards,
Ginger
- July 19, 2014 at 5:38 pm #3308
Tuler
ParticipantHi Ginger, thank you for the reply. Code snippets would be great!
- July 27, 2014 at 10:26 pm #3356
Ginger Coolidge
ParticipantHi there,
Sorry it took me a while to get back with you. Your site is looking great! I was experimenting on my test site to verify option #1 above. I believe #1 is the most straight forward. To accomplish this you’ll need to make a small change in your functions.php file.
The change we are making is to prevent the featured image from being included in the top of that specific page’s content. You can still set the featured image so it shows up on the home page widgets. This way you can insert your own image sized wide enough for the full page width you increased.
In your functions.php file, look for the code that starts with the comment
//Add featured image above single posts.
In this section of code, add your page_id to the conditional. You can find the page id in your WordPress editor…click to edit that page and the url will end with something like this:
wp-admin/post.php?post=36&action=edit
On my test site, my page id is 36. (It says post but it is still a page.)
Back to the code, look for the conditional here:
// Return early if not a singular or does not have thumbnail if ( ! is_singular() || ! has_post_thumbnail() ) {
And add in the page id. So in my example it becomes:
if ( ! is_singular() || ! has_post_thumbnail() || is_page(36) ) {
Now I can add a big image to my page content and leave the featured image set.
I hope this helps accomplish what you would like to see!
- January 14, 2015 at 8:37 am #4271
Waterbaby
ParticipantGinger,
Is there a conditional for the community pages? I am looking to either remove the featured image from the individual community page or increase its size.
Thanks
- January 22, 2015 at 2:02 pm #4305
Ginger Coolidge
ParticipantHi there,
YES, you can add on to that conditional with this:
if ( ! is_singular() || ! has_post_thumbnail() || is_singular( 'wap-community' ) ) {
What we’ve added is the custom post type name which is wap-community. This will prevent the featured image from showing in the content, which means you can add another image manually if you like.
Regards,
-Ginger
- January 26, 2015 at 5:24 pm #4311
Chaseaidan
ParticipantGinger, do you know the code to remove the feature image from multiple pages?
I tried adding multiple page numbers to the same section, like below, but that didn’t work and I tried it a few other ways, but it blew up my site.
if ( ! is_singular() || ! has_post_thumbnail() || is_page(36,37,38) ) {
- January 26, 2015 at 7:44 pm #4313
Ginger Coolidge
ParticipantHi there,
Yes, have a look at my last post on this thread where I give an example of multiple page ids.
Best,
-Ginger
- AuthorPosts
- You must be logged in to reply to this topic.