-
Author
-
August 11, 2018 at 15:56 #205981ThrewTheNevRParticipant
Good day,
I’m trying to add a featured image above breadcrumb in my post content on my blog and so far I was able to use this function.
add_action(‘kleo_before_main’, ‘sq7rdu_show_featured_before_content’);
function sq7rdu_show_featured_before_content() {
if (is_single()) {
if (has_post_thumbnail()) {
echo ‘<div class=”fullwidth-image-before-content”>’;
echo the_post_thumbnail(‘full’);
echo ‘</div>’;
}
}
}
So far it produced the following image in the attachment below. As you can see the function worked but the size of the featured image does not appear to be full width.
I then tried to do it via css.
img.attachment-kleo-full-width {
width: 100% !important;
}
But no changes has been noticed. My question is there a way to automatically resize the featured image to be full width for blog post?
I ask because I also used this
if
( has_post_thumbnail() ) {
the_post_thumbnail(
'your-custom-size'
);
}
But no matter what sizes I used no changes have occurred even after clearing cache.Attachments:
You must be logged in to view attached files.August 11, 2018 at 16:09 #205984Kieran_SQModeratorHi,
I logged into your site to take a look at this for you. The image that was output was 525 x 350, which is the full size for the image, you can check this in WP Admin > Media. Try assigning a larger image (1920 x X) and see what results you get for the output.
Let me know,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
August 11, 2018 at 16:28 #206004ThrewTheNevRParticipantAhh i see now it worked.
By chance is there a function to make all featured Images once selected
In the a new post automatically set itself to custom size?August 11, 2018 at 16:36 #206010Kieran_SQModeratorHi,
You can do this by default in KLEO. Please go to WP Admin > Theme Options > Blog > Scroll to: ‘Enable Custom Image sizes’ and toggle to on.
Once you have saved your settings you will need to regenerate any thumbnails by installing and running the Regenerate Thumbnails plugin which can be found here for free https://wordpress.org/plugins/regenerate-thumbnails/
Thanks,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
August 11, 2018 at 17:50 #206040Kieran_SQModeratorHi,
You’re welcome, feel free to open a new ticket any time with any other questions and we’ll be happy to help.
All the best,
Kieran
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionIf you like the theme or the support you've received please consider leaving us a review on Themeforest!
Custom development requests can be sent to dev@seventhqueen.com, one of the development team will be happy to discuss your needs.
-
AuthorPosts
The forum ‘Bugs & Issues’ is closed to new topics and replies.