Friday, August 19, 2022
HomeWordPress Developmentplugins - Elementor Professional show featured picture on part -> model ->...

plugins – Elementor Professional show featured picture on part -> model -> picture utilizing shortcode


right here is my scenario:

1

I’m making an attempt to make the picture within the part (background) dynamic. I want to add a shortcode the place the background adjustments primarily based on what the featured picture is:

2

As you’ll be able to see above, I’m making an attempt to focus on the picture underneath types within the part with a shortcode that may doubtlessly do this.

Here’s what I’ve thus far in my backend:

add_shortcode('displayfeaturedimage', 'post_featured_img');

perform post_featured_img($atts) {
    international $put up;

    return '<img src="' . get_the_post_thumbnail($post->ID) . '" />';
}

I’m making an attempt to retrieve the picture supply however this appears flawed. Any assist with corrections could be appreciated.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments