Tagged: x
-
AuthorPosts
-
October 28, 2016 at 3:27 pm #1235223
jonesy2367ParticipantHi
I’m just using the regular WordPress gallery – is it possible to add a next/previous link in the attachment pages?
thanks
October 29, 2016 at 12:01 am #1235605
Rue NelModeratorHello There,
Thanks for writing in! Because what you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
After the child theme is set up, please add the following code in your child theme’s functions.php file
// Add Next and Previous buttons in the attachment page // ============================================================================= add_action( 'x_after_the_content_end', 'add_next_prev_buttons' ); function add_next_prev_buttons(){ ?> <?php if ( is_attachment() ) : ?> <nav id="image-navigation" class="navigation image-navigation"> <div class="nav-links"> <?php previous_image_link( false, '<div class="previous-image">' . __( '« Previous Image', '$text_domain' ) . '</div>' ); ?> <?php next_image_link( false, '<div class="next-image">' . __( 'Next Image »', '$text_domain' ) . '</div>' ); ?> </div><!-- .nav-links --> </nav><!-- #image-navigation --> <?php endif; ?> <?php } // =============================================================================The code above will create a next and previous links at the button of the content area.
Hope this helps. Please let us know how it goes.
October 29, 2016 at 4:43 am #1235731
jonesy2367ParticipantThis reply has been marked as private.October 29, 2016 at 5:27 am #1235748
ThaiModeratorHi There,
Your website is password protected.
Please provide us with your password so we can take a closer look.
Thanks.
October 29, 2016 at 5:32 am #1235754
jonesy2367ParticipantThis reply has been marked as private.October 29, 2016 at 5:34 am #1235756
jonesy2367ParticipantThis reply has been marked as private.October 29, 2016 at 2:30 pm #1236110
RadModeratorHi there,
Next and previous only works on post types, hence, the attachment type on this case. There is no way it can tell the order if it’s just about the images in the gallery.
Thanks!
October 30, 2016 at 4:36 am #1236505
jonesy2367Participantsorry, are you sure?
…as (next_image_link) is in the WordPress codex so https://codex.wordpress.org/Function_Reference/next_image_link
and it says Usage..
Typically uses in attachment.php. In the WordPress default theme Twenty Eleven and Twenty Twelve, it is used in image.php.
<?php next_image_link( $size, $text ); ?>as it seems nonsensical to have a gallery function where you can add next/previous links that actually bear no relevance to the gallery (and only scroll through the media library, which bears no relationship to the gallery)?
October 30, 2016 at 4:49 am #1236510
ChristianModeratorHey there,
Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/. Thanks for understanding. Take care!
October 30, 2016 at 6:00 am #1236549
jonesy2367Participantyes it must be a wordpress glitch
October 30, 2016 at 6:26 am #1236560
ChristopherModeratorlet us know if you have further question.
October 30, 2016 at 10:52 am #1236709
jonesy2367Participant(i’ve just tested it with 2014 theme, which ships with next/previous links on the attachment page, and there’s no control over what appears on those links)
October 30, 2016 at 10:56 am #1236712
ChristianModeratorThanks for sharing. If you need more in depth changes, you might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1235223 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
