WordPress.org

Ready to get started?Download WordPress

Forums

Add image captions in timlnr plugin (1 post)

  1. elbe
    Member
    Posted 1 year ago #

    I am using the 'wp jquey timlnr' plugin and am getting stuck on how to integrate image captions. I would like to pull them directly from the caption field of each image so I can style them differently than the contents text. I have tried to edit this plugin file: "wp-jquery-timelinr/includes/template.php" to look something like below. But it doesnt work. Has anybody got any ideas on how to do this?

    <ul id="issues">
    	<?php
    	if ($query->have_posts()):
    		while ($query->have_posts()) : $query->the_post();
    
    			$timelineDate = get_post_meta($post->ID, 'timelineDate', 'true');
    			$image_caption = $post->post_excerpt;
    
    		 	echo '<li id="date'.$post->ID.'">';
    		 	echo get_the_post_thumbnail($post->ID, array(256,256) );
    			echo '<h1>'.$post->post_title.'</h1>';
    		 	echo '<p>'.$post->post_content.'</p>';
    
    			echo '<div class="timelnr-caption">' . $image_caption. '</div>'; 
    
    			echo '</li>';
    		endwhile;
    	?>
       	</ul>

Topic Closed

This topic has been closed to new replies.

About this Topic