right here is my scenario:
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:
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.