Warning: strpos(): Empty needle in /home/mobiloud/public_html/help/wp-content/plugins/sg-cachepress/core/Htaccess/Htaccess.php on line 106

Warning: Cannot modify header information - headers already sent by (output started at /home/mobiloud/public_html/help/wp-content/plugins/sg-cachepress/core/Htaccess/Htaccess.php:106) in /home/mobiloud/public_html/help/wp-content/plugins/sg-cachepress/core/Supercacher/Supercacher_Helper.php on line 46
Showing featured images in your News app – Help & Support
  1. Home
  2. Building a News app
  3. Showing featured images in your News app

Showing featured images in your News app

MobiLoud offers an option to include your featured image at the top of every article. This will be the default behaviour in your app.

If you’d rather show the image elsewhere in the article, for example below the title, you can use the Editor functionality and add the following code in any PHP positions, such as “PHP before content”.

$image_feature = wp_get_attachment_url( get_post_thumbnail_id($post->ID, 'mbblog-md') ); 
if(!empty($image_feature)) { 
echo "<img width='100%' src='".$image_feature."'>"; 
}

Related Articles