WordPress.org

Ready to get started?Download WordPress

Forums

Multiple Post Thumbnails
Use multipost thumbnail function in query posts (page template) (1 post)

  1. Woutermesker
    Member
    Posted 2 years ago #

    I'm using the plugin in my costum wordpress template it works great but i want it to work in a page template(in the header i use a slider)
    But the standard thumbnail works but my second doesn't work.
    I'm using the exactly same code as in my category template and there it works!...

    thanks allready!,, Wouter

    <div class="lof-mainteam">
    <center><strong>Elite / Beloften<br/></strong></center>
    <ul>
    <li><a href="http://localhost/normall/janvanarckel/?page_id=183">Informatie</a></li>
    <li>Het Team</li>
    <li>Programma</li>
    <li>Wie rijd waar?</li>
      </div>
    <div id="backgroundriders">
    <script language="javascript" type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.js"></script>
    <script language="javascript" type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/jquery.easing.js"></script>
    <script language="javascript" type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/script.js"></script>
    
    <script type="text/javascript">
     $(document).ready( function(){
    		var buttons = { previous:$('#lofslidecontent45 .lof-previous') ,
    						next:$('#lofslidecontent45 .lof-next') };
    
    		$obj = $('#lofslidecontent45').lofJSidernews( { interval : 4000,
    												direction		: 'opacitys',
    											 	easing			: 'easeInOutExpo',
    												duration		: 1200,
    												auto		 	: false,
    												maxItemDisplay  : 8,
    												navPosition     : 'horizontal', // horizontal
    												navigatorHeight : 68,
    												navigatorWidth  : 65,
    												mainWidth:640,
    												buttons			: buttons} );
    	});
    </script>
    <div id="lofslidecontent45" class="lof-slidecontent" style="width:640px; height:340px;">
    <div class="preload"><div></div></div>
     <!-- MAIN CONTENT -->
      <div class="lof-main-outer" style="width:640px; height:340px;">
      	<ul class="lof-main-wapper">
    
    <?php
    $args = array(
    	'cat'      => 13
    );
    query_posts( $args ); ?>
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    	  <li>
    <?php
    //This must be in one loop
    
    if(has_post_thumbnail()) {
    
    	the_post_thumbnail(array(265,150,true));
    
    } else {
    	echo '<img src="'.get_bloginfo("template_url").'/images/defaultrenner.png" />';
    }
    ?>
                     <div class="lof-main-item-desc">
    <table width="300" border="0px">
      <?php if( get_post_meta( $post->ID, "Naam", true ) ) : ?>
      <tr>
        <td>Naam</td>
        <td><?php echo get_post_meta( $post->ID, "Naam", true ); ?></td>
      </tr>
      <?php endif; ?>
      <?php if( get_post_meta( $post->ID, "Leeftijd", true ) ) : ?>
      <tr>
        <td>Leeftijd</td>
        <td><?php echo get_post_meta( $post->ID, "Leeftijd", true ); ?></td>
      </tr>
      <?php endif; ?>
      <?php if( get_post_meta( $post->ID, "Woonplaats", true ) ) : ?>
      <tr>
        <td>Woonplaats</td>
        <td><?php echo get_post_meta( $post->ID, "Woonplaats", true ); ?></td>
      </tr>
      <?php endif; ?>
      <?php if( get_post_meta( $post->ID, "Specialistme", true ) ) : ?>
      <tr>
        <td>Specialistme</td>
        <td><?php echo get_post_meta( $post->ID, "Specialistme", true ); ?></td>
      </tr>
      <?php endif; ?>
    </table>
                <a href="<?php the_permalink(); ?>">Lees meer</a> </div>
            </li>
    <?php endwhile; endif;wp_reset_query(); ?>
    </ul>
      </div>
      <!-- END MAIN CONTENT -->
        <!-- NAVIGATOR -->
    <div class="lof-navigator-wapper">
    
            <div onclick="return false" href="" class="lof-previous">Previous</div>
          <div class="lof-navigator-outer">
                <ul class="lof-navigator">
    <?php
    $args = array(
    	'cat'      => 13
    );
    query_posts( $args ); ?>
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    	  <li>
    <?php
    if (class_exists('MultiPostThumbnails')&& MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) {
    
    	MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image');   
    
    } else {
    	echo '<img src="'.get_bloginfo("template_url").'/images/defaultrenner.png" />';
    }
    ?>  
    
          </li>
    	  <?php endwhile; endif;wp_reset_query(); ?>
        </ul>
          </div>
            <div onclick="return false" href="" class="lof-next">Next</div>
     </div> 
    
     </div> 
    
    </div >

    http://wordpress.org/extend/plugins/multiple-post-thumbnails/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic