image through shortcode showing before title
-
Hello, I meet a problem I cannot explain. I’ve created several shortcodes to insert content in single content and, if text through shortcodes shows at the good place, an image shows… before the title, whatever I place the shortcode.
// shortcode pour fse-alternative function shortcode_fsealternative(){ global $post ; $alternativeimage = get_post_meta($post->ID, 'alternative_image', true); if (!empty($alternativeimage)) { $urlcmm='https://xxx/blog/wp-content/uploads/alternative/'.$alternativeimage; } else { $urlcmm='https:/xxx/blog/wp-content/uploads/images-site/click-x-640.png'; if ( !is_single() ) { $urlcmm='https://xxx/blog/wp-content/uploads/images-site/click-x-home.png';} } echo '<figure class="wp-block-post-featured-image"><img src="' . $urlcmm . '" /></figure>'; } add_shortcode('fsealternative', 'shortcode_fsealternative');
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘image through shortcode showing before title’ is closed to new replies.