Your since83_pagination()
function is assuming the main query– $wp_query
— but you are needing to paginate something very different. You need to be paginating the results in $attachments
which you are retrieving with get_children()
. That was my guess as soon as I saw this question.
You are going to need to rethink this. There are two options that come to mind.
If you are happy with passing pagination data in the URL use paginate_links()
. That is probably the easiest option. I have written a few answers on using paginate_links
.
Your other option is to use a filter on pre_get_posts
. I do not have working code to post but I expect that this will be harder.
I would say, figure out which route you want to go, get started, and post your new code. I will edit the answer in light of the new code.
Related Posts:
- Pagination between images (active/inactive)
- Gallery Images could not be shown
- Paginate Gallery [closed]
- Prevent WordPress from adding image’ title automatically
- Overide Gallery Default Link to Settings
- get_post_gallery with Gutenberg
- How to have different captions for same image, for galleries?
- WP 3.5 and Galleries – how to count images?
- Navigate with keyboard in Gallery shortcode
- Cropped featured image replaces original image in gallery
- Displaying images with relative paths in the editor
- Bulk edit wordpress images alt and title attributes
- Change the output for [gallery] shortcode
- How do you modify the HTML output of a Gallery item (using the gallery shortcode)?
- How to include externally hosted images into a gallery block
- Excludes posts that don’t have attachments in the_content()
- Use Media Library to manage galleries like Nextgen (with folders, albums, collections, tags, categories, terms…)
- How to remove title attribute from gallery links and images
- How can I make all gallery images to open in a new window?
- Caption in Page adding unwanted 10px to width
- The WordPress Gallery, Grabbing The Link and Images?
- Displaying a featured image (only img url) as the img src?
- How to force WordPress to add new images at the beginning of the gallery?
- How to link Gutenberg Gallery images To Media file automatically?
- get attributes/part of the gallery shortcode
- Editing built in Gallery shortcode to filter by categories
- Gallery images stored elsewhere (preferably Google Drive)
- WordPress gallery previous/next buttons showing all media library images
- Any way to “combine” galleries or show multiple galleries as one?
- Gallery post images on homepage?
- How to create a simple slideshow out of a post image gallery?
- How to change the target size of images clicked on in WordPress standard gallery
- Exclude featured image from gallery in wp-admin
- WooCommerce-like featured gallery
- Override img class in gallery
- Extracting gallery images in WordPress 3.5 on index.php
- wordpress get gallery images title
- How to use photo in multiple posts?
- Exclude images from “inserted into post” when trying to get attachments
- Is this post using WordPress Gallery?
- Turn off image captions in gallery view?
- Customizing the attachement page to show rest of all images in a gallery from post
- Unyson Framework doesn’t show gallery images
- Retrieve an array of image URLs that belong to a gallery
- Ho to add “Create Slider” option to default “Add Media” popup?
- How to make a gallery with dynamic images from URLs?
- How can I display an image description, from an image gallery?
- wordpress post pagination with image buttons?
- Gallery with thumbnail carousel
- Ways to show multiple, separate galleries per post?
- Native gallery sorting is ignored
- Using Jetpack carousel w/o creating a gallery [closed]
- How to get the Gallery form/section just like in Gutenberg block?
- Media gallery images url instead of ID on WP API Response
- Load Gallery Images with Title on Homepage BX Slider
- Get all image IDs from the Media Library
- Allow users to contribute images to a post
- How to remove the images from “Uploaded to this post”?
- limit number of images shown from gallery
- How to automatically populate a gallery with images attached to posts of one category?
- What is the plugin to import image from URL?
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- photo gallery implementation like tmz
- How do I display the featured image from an image gallery using a reference in code? (example within)
- How to enlarge thumbnail on mouseover?
- attach several images to post + gallery
- get_post_gallery with Gutenberg
- How to change Gallery image url in product page ? In function.php?
- How do you obtain a list of all image file names on a wordpress website for replacement?
- Implementing a modal(lightbox) for all images in all post-gallery posts
- how automatically show the image title before the image caption/description in a wordpress gallery?
- Images getting smashed
- change the h3 subtitles of the wordpress gallery shortcode
- How to re-arrange images in default WP Gallery more than one image at once?
- Convert multiple image blocks to gallery block in Gutenberg?
- get_post_gallery with Gutenberg
- Images 404 after wp migration to a subdomain
- Exclude first image from a Woocommerce image gallery
- How to see previous –next image option in the theme?
- How do i replace the title attribute of img tag with the image caption
- Gallery with shortcode not showing
- attachment.php & flexslider—linking thumbnail to specific image
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Page loads all pages of the image gallery with pagination
- Breadcrumbs for Single Image page
- Thickbox not displaying just the image, instead showing full page in lightbox
- Editing Featured Image Display When Creating Post
- Multiple gallery thumnbnails on one page
- Slider do not add alt attribute. Cant get alt attribute from a media library!
- how to display all images from their siblings/ from same parent?
- wp_get_attachment_link() add rel attribute if the link points to direct image
- How do I set the sizes of my thumbnails when inserting a [gallery]?
- *box for images displayed as a post’s [gallery] [duplicate]
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- adding images to wordpress pagination?
- Adding different classes to different images depending on size for fine control of image layout in posts
- Featured Image not changing
- Automatically adding blog images to a portfolio/gallery
- Image Attachments Query Not Working If Post Is Loaded Via Ajax