This topic has 5 replies, 2 voices, and was last updated 6 years by Kieran_SQ.

  • Author
  • #205981
     ThrewTheNevR
    Participant

    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.
    #205984
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

    #206004
     ThrewTheNevR
    Participant

    Ahh 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?

    #206010
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

    #206039
     ThrewTheNevR
    Participant

    Awsome thanks Kieran.

    #206040
     Kieran_SQ
    Moderator

    Hi,

    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 solution

    If 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.

Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘Bugs & Issues’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?