- This topic has 22 replies, 4 voices, and was last updated 2 years, 3 months ago by Elvin.
-
AuthorPosts
-
January 7, 2022 at 5:38 pm #2072880Charles
Adjusting single blog page parameters in the customizer changes name and date but does not change any featured image aspects. Thanks.
January 7, 2022 at 5:40 pm #2072884LeoStaffCustomer SupportHi 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-informationLet me know 🙂
January 7, 2022 at 6:23 pm #2072930CharlesJanuary 7, 2022 at 6:38 pm #2072951LeoStaffCustomer SupportAre you referring to these images?
https://www.screencast.com/t/wlpGre0InThat section is coming from a third-party plugin so GP’s customizer settings wouldn’t apply.
January 7, 2022 at 8:43 pm #2072990CharlesOh, sorry, no, I meant featured images on single posts.
How can I change the size of this featured image, for instance?
January 8, 2022 at 6:38 am #2073247DavidStaffCustomer SupportHi 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.
January 8, 2022 at 8:42 am #2073505CharlesThis 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/January 8, 2022 at 11:48 am #2073638LeoStaffCustomer SupportI just checked the page above and it doesn’t have a featured image:
https://www.screencast.com/t/sY6OQgSRJanuary 8, 2022 at 1:48 pm #2073730LeoStaffCustomer SupportYou 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!
January 8, 2022 at 2:57 pm #2073764CharlesYes, it’s input as a 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 );
}January 8, 2022 at 2:58 pm #2073765CharlesAnd then I must be turning off the featured image itself somewhere else.
January 8, 2022 at 3:15 pm #2073775CharlesI guess it’s not just moving the featured image it’s making a separate image using the featured image thumbnail?
January 8, 2022 at 4:19 pm #2073812LeoStaffCustomer SupportWhat happens if you remove the functions for now?
January 8, 2022 at 4:32 pm #2073822CharlesThe featured image is at the top of the page and follows the sizing from the customizer blog page parameters as it should.
January 9, 2022 at 5:53 am #2074160CharlesBut I’d still like it to appear after the 2nd paragraph…
-
AuthorPosts
- You must be logged in to reply to this topic.