• Resolved valery2016

    (@valery2016)


    Hi All!
    I created a slideshow (gallery post format):

    <div id="post-gallery-<?php the_ID(); ?>" class="orbit" role="region" aria-label="post-gallery-<?php the_ID(); ?>" data-orbit>
      <!-- Wrapper for slides -->
      <ul class="orbit-container" >
         <?php
         $i = 0;
         foreach( $attachments as $attachment ):
         $active = ( $i == 0 ? ' is-active': '' );
         ?>
         <li class="orbit-slide<?php echo $active; ?>">
            <img class="orbit-image" src="<?php echo wp_get_attachment_url($attachment->ID); ?>" />
         </li>
         <?php
             $i++;
             endforeach;
         ?>
      </ul><!--.orbit-container-->
    </div><!--.orbit-->

    Everything is working!

    Now I want to display a slide show on the home page

    <?php
    	//Include gallery posts
    	$args = array(
    		'tax_query' => array(
    			array(
    				'taxonomy' => 'post_format',
    				'field'    => 'slug',
    				'terms'    => array( 'post-format-gallery' ),
    			),				 
    		),	  
    	);
    	$galleryPost = new WP_Query( $args );
    		if ( $galleryPost->have_posts() ) :
    			while ( $galleryPost->have_posts() ) : $galleryPost->the_post(); ?>
    			<!--<pre><?php print_r($galleryPost); ?></pre>-->
    			<div class="medium-4 columns">
    				<div class="callout" data-equalizer-watch="galleryone">
    				<?php
    					the_title( '<h4 class="entry-title">', '</h4>' );
    					the_content();
    					the_meta();
    				?>
    				</div>
    			</div>
    			<?php endwhile;
    		else :
    		endif;
    	wp_reset_postdata();
    ?>

    It displays all the images (slideshow does not work).

    If I use inside the loop
    get_template_part( 'template-parts/post/content', 'gallery' );
    , nothing is displayed

    I need help, please

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom slideshow on front page’ is closed to new replies.