-
AuthorPosts
-
April 27, 2021 at 10:29 am #1296937
Hey there,
i can`t for the life of me figure out how to display the featured image on the portfolio page. is this achievable?
thanks,
richardApril 29, 2021 at 12:43 pm #1297325Hey floka168,
Thank you for the inquiry.
Did you switch the editor to the advance layout builder (ALB)? The featured image will not display automatically when ALB is active. You have to manually insert an Image element or a Slider from the builder to display an image in the portfolio page. If the classic or default editor is active, the featured image should display automatically.
Best regards,
IsmaelApril 29, 2021 at 2:57 pm #1297375you can have on child-theme functions.php this:
function thumbnail_in_content($atts) { global $post; return get_the_post_thumbnail($post->ID); } add_shortcode('thumbnail', 'thumbnail_in_content');
you use it on the pages / posts as shortcode then:
[thumbnail]
April 29, 2021 at 3:01 pm #1297377maybe this could be an informative topic: https://kriesi.at/support/topic/beitragsbild-eines-blogbeitrags-automatisch-anzeigen/#post-1202606
this little Snippet enables you to set even on alb based portfolios/posts the featured image if meta-box is set to : “show on single entry”:
function avf_template_builder_content_postimage_mod($content = ""){ if(is_singular('post') && ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) || is_singular('portfolio') && ( '1' != get_post_meta( get_the_ID(), '_avia_hide_featured_image', true ) ) ) { $featuredImage = get_the_post_thumbnail( $the_id, 'entry_with_sidebar' ); $content = '<div class="post-image">' .$featuredImage. '</div>' . $content ; } return $content; } add_filter('avf_template_builder_content', 'avf_template_builder_content_postimage_mod', 10, 1);
on that line:
$featuredImage = get_the_post_thumbnail( $the_id, 'entry_with_sidebar' );
you decide what dimension the source of the image has ( entry_with_sidebar ) is 845×321May 1, 2021 at 2:12 pm #1297708April 29, 2022 at 8:31 am #1349904Hi
I’m facing the similar issue, couldn’t set thumbnail image? May I know what’s your solution? Thanks!April 29, 2022 at 12:00 pm #1349949Hi kimhoegcit,
Please open a new thread and include WordPress admin login details in private, so that we can have a closer look at your site.
Best regards,
Rikard -
AuthorPosts
- The topic ‘Display featured image on portfolio page’ is closed to new replies.