• Hey! I’m using custom posts for a nivoslider on a wordpress site im building. The idea is to go to WP–>Slideshow –> add picture (also put in title and content). and it automatically adds it to the slide. On top of the image, I’ve put the title for the slide shown for the time being. This works uniquely for all slides, the title changes properly to match what image is shown through my loop.

    Now, the problem! I want to display the content too, which is going to be a description of the image (product). However the loop creates an IMG tag with the slides and the content is put into either a “content” or “alt” value in the IMG tag.

    This is the current code for creating this.

    <!-- CUSTOM POST SLIDER -->
    
    <div class="slider-wrapper theme-bar">
    	<div class="ribbon"></div>
    		<div id="slider" class="nivoSlider">
    		        <?php
    			          $temp = $wp_query;
    			          $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    			          $post_per_page = 100; // -1 shows all posts
    			          $args=array(
    			            'post_type' => 'slideshow',
    			            'orderby' => 'date',
    			            'order' => 'ASC',
    			            'paged' => $paged,
    			            'posts_per_page' => $post_per_page
    			          );
    			            	$wp_query = new WP_Query($args); 
    
    								if( have_posts() ) : while ($wp_query->have_posts()) : $wp_query->the_post();
    				?>
    
    		        	<?php
    			            $custom = get_post_custom($post->ID);
    			            $url = $custom["url"][0];
    			            $url_open = $custom["url_open"][0];
    			            $custom_title = "#".$post->ID;
    					?>
    						<?php if ($url != "") { ?>
    
    							<?php } else { ?>
    								<?php the_post_thumbnail('slider', array('title' => get_the_title())); ?>
    							<?php }?>
    
    								<?php endwhile; else: ?>
    								<?php endif; wp_reset_query(); $wp_query = $temp ?>
    
    		</div><!-- #SLIDER END -->

    How would I get the content to show uniquely as the title does? If I try to “print the_content()” it gives me all of the contents for all the slides!

    Sincerely, Sebastian

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Fetching the_content from a custom post image’ is closed to new replies.