• Hi. I am having probs with widget slideshow.

    It worked pefectly until i did some modify to my loops for displaying posts.

    i use two loops. One to show the 1st post, and offset to display others excluding the previous:

    my code:

    function my_post_limit($limit) {
    	global $paged, $myOffset;
    	if (empty($paged)) {
    			$paged = 1;
    	}
    	$postperpage = intval(get_option('posts_per_page'));
    	$pgstrt = ((intval($paged) -1) * $postperpage) + $myOffset . ', ';
    	$limit = 'LIMIT '.$pgstrt.$postperpage;
    	return $limit;
    } //end function my_post_limit

    1st loop:

    <?php $cat_id = get_query_var('cat'); ?>
    <?php if ($paged < 2 ){
    	$post_query = 'cat='.$cat_id.'&posts_per_page=1'; ?>
    
    				<?php query_posts( $post_query ); ?>
    					<?php if (have_posts()) : ?>
    						<?php while (have_posts()) : the_post();

    2nd loop using offset and pagination:

    <?php add_filter('post_limits', 'my_post_limit'); ?><?php
    global $myOffset;
    $myOffset = 1;
    $temp = $wp_query;
    $wp_query= null;
    $wp_query = new WP_Query();
    $wp_query->query('cat='.$cat_id.'&offset='.$myOffset.'&paged='.$paged);
    ?>
    
    <div id="posts-list-category">
    	<?php if (have_posts()) : ?>
    		<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>

    WELL. after using add_filter(‘post_limits’, ‘my_post_limit’);
    images on widget slidshow disappear and i get We cannot display this gallery
    If i remove the filter. slideshows works but pagination is broken.

    any help?

    https://www.ads-software.com/plugins/nextgen-gallery/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor photocrati

    (@photocrati)

    @mrenrich – Unfortunately we really do not offer support for customizations that are out of the scope of the plugin. I would suggest reviewing your customizations and tracing it to ensure that you are getting the results you expect at all points.

    – Cais.

    Thread Starter mrenrich

    (@mrenrich)

    i just asked to discover if there’s a conflict with some wordpress functions or filters, limit posts for example, that’s all.

    Plugin Contributor photocrati

    (@photocrati)

    @mrenrich – To the best of our knowledge there are no conflicts with WordPress core functions as is.

    – Cais.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘We cannot display this gallery using offset and pagination loops’ is closed to new replies.