[Resolved] Featured image parameter

Home Forums Support [Resolved] Featured image parameter

Home Forums Support Featured image parameter

Viewing 15 posts - 1 through 15 (of 23 total)
  • Author
    Posts
  • #2072880
    Charles

    Adjusting single blog page parameters in the customizer changes name and date but does not change any featured image aspects. Thanks.

    #2072884
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field:
    https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

    Let me know 🙂

    #2072930
    Charles
    #2072951
    Leo
    Staff
    Customer Support

    Are you referring to these images?
    https://www.screencast.com/t/wlpGre0In

    That section is coming from a third-party plugin so GP’s customizer settings wouldn’t apply.

    #2072990
    Charles

    Oh, sorry, no, I meant featured images on single posts.

    How can I change the size of this featured image, for instance?

    https://gettysburgconnection.org/gettysburg-hospital-often-operating-on-divert-status-sends-patients-to-neighboring-hospitals/

    #2073247
    David
    Staff
    Customer Support

    Hi there,

    i think theres some crossed wires – looking at the post your provided – there is no featured image being displayed. Only images that are within the content of the post. The size of those images are defined when they are added to the post content its not something the theme controls.

    #2073505
    Charles

    This page has a featured image. I think it is full size, but I’d like to make it not stretch across the page.
    https://gettysburgconnection.org/sidney-poitier-hollywoods-first-black-leading-man-reflected-the-civil-rights-movement-on-screen/

    #2073638
    Leo
    Staff
    Customer Support

    I just checked the page above and it doesn’t have a featured image:
    https://www.screencast.com/t/sY6OQgSR

    #2073730
    Leo
    Staff
    Customer Support

    You said:

    But it shows as a featured image when I edit it.

    Are you referring to the featured image option here?
    https://docs.generatepress.com/article/adding-featured-images/

    Please reply here and not through e-mail.

    Thanks!

    #2073764
    Charles

    Yes, it’s input as a featured image:

    featured image

    But I do have this PHP to move it to after the 2nd paragraph:

    add_filter( ‘the_content’, ‘insert_featured_image’, 20 );
    function insert_featured_image( $content ) {
    $feat_img = get_the_post_thumbnail($post->ID, ‘post-single’);
    if ( is_single() && ! is_admin() ) {
    return prefix_insert_after_paragraph( $feat_img, 2, $content );
    }
    return $content;
    }
    // Parent Function that makes the magic happen
    function prefix_insert_after_paragraph( $insertion, $paragraph_id, $content ) {
    $closing_p = ‘</p>’;
    $paragraphs = explode( $closing_p, $content );
    foreach ($paragraphs as $index => $paragraph) {
    if ( trim( $paragraph ) ) {
    $paragraphs[$index] .= $closing_p;
    }
    if ( $paragraph_id == $index + 1 ) {
    $paragraphs[$index] .= $insertion;
    }
    }
    return implode( ”, $paragraphs );
    }

    #2073765
    Charles

    And then I must be turning off the featured image itself somewhere else.

    #2073775
    Charles

    I guess it’s not just moving the featured image it’s making a separate image using the featured image thumbnail?

    #2073812
    Leo
    Staff
    Customer Support

    What happens if you remove the functions for now?

    #2073822
    Charles

    The featured image is at the top of the page and follows the sizing from the customizer blog page parameters as it should.

    #2074160
    Charles

    But I’d still like it to appear after the 2nd paragraph…

Viewing 15 posts - 1 through 15 (of 23 total)
  • You must be logged in to reply to this topic.