Place Images throughout the content
-
Hello,
Get plugin, about time WP made this part of the whole package.
Anyway, I’m trying to get the dynamic featured images showing through out the content using the phpcode below
<?php $paragraphAfter[1] = '<div>AFTER FIRST</div>'; //display after the first paragraph $paragraphAfter[3] = '<div>AFTER THIRD</div>'; //display after the third paragraph $paragraphAfter[5] = '<div>AFTER FIFtH</div>'; //display after the fifth paragraph $content = apply_filters( 'the_content', get_the_content() ); $content = explode("</p>", $content); $count = count($content); for ($i = 0; $i < $count; $i++ ) { if ( array_key_exists($i, $paragraphAfter) ) { echo $paragraphAfter[$i]; } echo $content[$i] . "</p>"; }?>
How do I go about incorporating the display if each featured image..?
<?php if( class_exists('Dynamic_Featured_Image') ) { global $dynamic_featured_image; global $post; $featured_images = $dynamic_featured_image->get_featured_images( $post->ID ); foreach($featured_images as $image) { $url = $image['full']; $caption = $dynamic_featured_image->get_image_caption($image['full']); $title = $dynamic_featured_image->get_image_title($image['full']); //print_r($featured_images); echo "<div class='side-thumb'><div class='screenshot'>"; echo "<a href='".$image['full']."' alt='".$caption."' title='".$title."' rel='lightbox'>"; echo "<img src='".$url."' title='".$title."' />"; echo "</a><div class='screenshot-caption screenshot-caption_right'><h3>"; echo $caption; echo "</h3></div></div></div>"; } } ?>
Thanks
Waynehttps://www.ads-software.com/plugins/dynamic-featured-image/
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Place Images throughout the content’ is closed to new replies.