How to display html element and php string in the same line?

You must not use use echo or print in a shortcode function. The echoed string will be printed out immediately when the content is processed, which is almost always too early. So in your function you should just return the string without using echo: function swh_woocommerce_store_credit_shortcode() { $store_credits = swh_woocommerce_get_store_credits(); return “<span style=”display: inline;”>Remaining Credit:</span>” … Read more

How to remove image size inline style in article and include caption

Really not sure why you would want to do something like that. As Jacob Peattie said those dimenstion are there to prevent layout shift when images are being loaded. But if you still want to remove width and height attributes you could do this. add_filter(‘post_thumbnail_html’, ‘bt_remove_post_thumbnail_html_width_height’, 10, 4); function bt_remove_post_thumbnail_html_width_height ($html, $post, $post_thumbnail_id, $size) { … Read more