• I am using a Theme called solstice. and on the home page i am using the ajax plugin for infinite scroll to display latest posts on home page.
    The problem is that by default all the sliders loads however after using the plugin
    The sliders wont work. however all the posts which are of standard post format work quite well.

    I am using the following code snippet as default template for ajax load more plugin.
    <article <?php post_class(‘blog-post blog-post-wrapper col-md-12’); ?>>
    <aside>
    <?php
    $temppostvar = get_post_format();
    echo $temppostvar;
    if($temppostvar == “gallery”):
    echo “inside gallery loop”;
    $gallery = solstice_get_post_opt(‘post-gallery’);
    echo $gallery;
    if(is_array($gallery) && !empty($gallery)): ?>
    <div class=”blog-post-slider pf-gallery mb-0″>
    <?php foreach ($gallery as $item): ?>
    <article class=”blog-post”>hello
    <header class=”pt-0″>
    <figure>
    <?php if (isset($item[‘attachment_id’])):
    echo wp_get_attachment_image( $item[‘attachment_id’], ‘solstice-medium-alt’, array(‘alt’ => esc_attr($item[‘title’])) );
    endif; ?>
    </figure>
    </header>
    </article>
    <?php endforeach; ?>
    </div><!– /slider –>
    <?php endif;
    else:
    echo “inside post loop”;
    if(has_post_thumbnail()): ?>
    <figure>
    <?php the_post_thumbnail(‘solstice-big’); ?>
    </figure>
    <?php endif;
    endif;?>
    </aside>
    <div class=”contents”>
    <header class=”pt-0″>
    <ul class=”categories”>

    • <?php echo get_the_category_list( __( ‘ , ‘, ‘solstice’ ) );?>
    • <h3>” target=”<?php echo esc_attr($post_target); ?>”><?php the_title(); ?></h3>
      <?php get_template_part(‘templates/blog/meta’); ?>
      </header>
      <div class=”post-content”>
      <?php echo solstice_auto_post_excerpt(solstice_get_opt(‘general-excerpt’)); ?>
      </div><!– /post-content –>
      </div>
      </article>

      i did some debugging and i figured out that it enters the loop all the excerpts and title is displayed however the following theme function does not work.. due to which the sliders for posts do not come up.

      The code is on line number 8:
      $gallery = solstice_get_post_opt(‘post-gallery’);

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Sliders for posts not loading in repeating template.’ is closed to new replies.