Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

category-portfolio.php

 <?php get_header(); ?>             
    div class="container">
     <?php query_posts('posts_per_page=8&cat=16'); ?>
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>     
        <article>
        <div class="post" id="post-<?php the_ID();?>">          
        <div class="container">
        <h3><?php the_title(); ?> </a></h3> 
        </div>
        <div class="container wrapper ">
        <div class="twelve columns alpha">
        <div id='mySwipe' style='max-width:700px; margin:0 auto' class='swipe'>
        <div class='swipe-wrap'>
                <?php  the_content(); ?>    
        </div> <!--swipe-wrap -->
        </div>  <!--mySwipe -->
        <div class="arrow"> 
    <div class="arrow-left" onclick='mySwipe.prev()'><img src="<?php echo get_bloginfo('template_directory'); ?>/images/arrow_left.png" alt="arrow"/></div> 
    <div class="arrow-right" onclick='mySwipe.next()'><img src="<?php echo get_bloginfo('template_directory'); ?>/images/arrow_right.png" alt="arrow"/></div>
                </div> <!--arrow -->
</div><!--12 columns -->                            
    <div class="four columns last details omega">
    <strong>Title</strong> </br><?php print_custom_field('title_site'); ?><br />
    <strong>Description</strong> </br><?php print_custom_field('Description_site'); ?><br />
    <strong>Tasks</strong> </br><?php print_custom_field('Tasks'); ?><br />
    <strong>Website</strong> </br><?php print_custom_field('visit'); ?><br />
    </div>
</div>
</div> <!--post-->                      
    </article>          
        <?php endwhile; ?>                      
            <?php else : ?>     
            <h3> Not found </h3>        
            <?php endif; ?>
            <?php wp_reset_query(); ?>
    </div>          
    </div>
<?php get_footer(); ?>

functions.php

function load_my_scripts() {
wp_register_script( 'swipe.js', get_template_directory_uri() .'/js/swipe.js');
wp_enqueue_script( 'swipe.js');
add_action('wp_enqueue_scripts','load_my_scripts'); 

header.php

<script type="text/javascript">
jQuery(document).ready(function($)
{
(function() {
    var elem = document.getElementById('mySwipe');
window.mySwipe = Swipe(elem, {
  // startSlide: 4,
  // auto: 3000,
  // continuous: true,
  //disableScroll: true,
  // stopPropagation: true,
  // callback: function(index, element) {},
  // transitionEnd: function(index, element) {}
});

//with jQuery
window.mySwipe = $('#mySwipe').Swipe().data('Swipe');
})();
});
</script>

When i publish one post image slider and description are available. When i publish more than one post the image slider is not available but not for the case of description which is available. Also, when i delete the swipe for the template and leaves only the <?php the_content(); ?> the images are available. Why this happened and how can resolve this problem;

Thanks in advanced.

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.