Jump to content

Pagination Troubles...


totallytech

Recommended Posts

Hey Guys,

 

I'm using a script within my wordpress site, but the author is not responding to any questions so I'm hoping someone here could help me out...

 

One gallery I uploaded has 280 images, When viewing the gallery I see the first 20 images and just a simple “More Images” and “Previous Images” links.

 

Is there a way to set it so it displays something like:

 

Images 1-20 of 280 displayed.

Results: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Next >>

 

function display_galleries() {

//allow plugins to overwrite output
$output = apply_filters('ims_before_galleries', '', $this->gallery_tags, $this);
if ('' != $output) return $output;

extract($this->gallery_tags);

global $post, $wp_query;
$attach = ( (!empty($this->opts['attchlink']) && empty($this->meta['_to_attach'][0])) || !empty($this->meta['_to_attach'][0]));

if (!empty($post->post_excerpt) && $this->in_array($this->imspage, array('photos', 'slideshow')))
$output = '<div class="ims-excerpt">' . $post->post_excerpt . '</div>';

$output .= "<{$gallerytag} id='ims-gallery-" . $this->galid . "' class='ims-gallery' itemscope itemtype='http://schema.org/ImageGallery'>";

foreach ($this->attachments as $image) {
$title = get_the_title($image->ID);

if (!empty($image->post_parent)) {
$title = get_the_title($image->post_parent);
$link = get_permalink($image->post_parent);
} elseif ($attach) {
$link = get_permalink($image->ID);
} else {
$image->meta['class'] = 'photo ims-colorbox';
$link = $this->get_image_url($image->ID);
}

$image->meta += array( 'link' => $link, 'alt' => $title, 'caption' => $title, 'title' => $title);
$output .= $this->image_tag( $image->ID, $image->meta );
}


$output .= "</{$gallerytag}>";

$wp_query->is_single = false;


$output .= '<div class="ims-navigation">';
$output .= '<div class="nav-previous">' . get_previous_posts_link(__('<span class="meta-nav">←</span> Previous images', 'ims')) . '</div>';
$output .= '<div class="nav-next">' . get_next_posts_link(__('More images <span class="meta-nav">→</span>', 'ims')) . '</div>';
$output .= '</div><div class="ims-cl"></div>';

$wp_query->post_count = 1;
$wp_query->is_single = true;


$this->visited_gallery(); //register visit

return $output;
}

 

I believe that is the code that actually writes the pagination area, I'm happy to post any other code if needed. Can anyone help me out please?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.