Tagged: x
-
AuthorPosts
-
May 17, 2016 at 5:16 am #995172
rosstmParticipantI am trying to change the functionality of the arrows so that they will only cycle through the current portfolio category rather than all portfolio posts. I have found the following code on other similar support threads, but when I try it, the arrows do not render at all.
function x_entry_navigation() { $stack = x_get_stack(); if ( $stack == 'integrity' ) { $left_icon = '<i class="x-icon-chevron-left" data-x-icon=""></i>'; $right_icon = '<i class="x-icon-chevron-right" data-x-icon=""></i>'; } else { $left_icon = '<i class="x-icon-arrow-left" data-x-icon=""></i>'; $right_icon = '<i class="x-icon-arrow-right" data-x-icon=""></i>'; } $is_ltr = ! is_rtl(); $prev_post = get_adjacent_post( true, '', false ); $next_post = get_adjacent_post( true, '', true ); $prev_icon = ( $is_ltr ) ? $left_icon : $right_icon; $next_icon = ( $is_ltr ) ? $right_icon : $left_icon; ?> <div class="x-nav-articles"> <?php if ( $prev_post ) : ?> <a href="<?php echo get_permalink( $prev_post ); ?>" title="<?php __( 'Previous Post', '__x__' ); ?>" class="prev"> <?php echo $prev_icon; ?> </a> <?php endif; ?> <?php if ( $next_post ) : ?> <a href="<?php echo get_permalink( $next_post ); ?>" title="<?php __( 'Next Post', '__x__' ); ?>" class="next"> <?php echo $next_icon; ?> </a> <?php endif; ?> </div> <?php }May 17, 2016 at 5:20 am #995174
rosstmParticipantThis reply has been marked as private.May 17, 2016 at 10:53 am #995693
RupokMemberHi there,
Can you enable WP_DEBUG mode? You can do this by opening
wp-config.phpand adding
define( 'WP_DEBUG' , true );just above/* That's all, stop editing! Happy blogging. */For example:define('WP_DEBUG', true); /* That's all, stop editing! Happy blogging. */When you revisit the page with the white screen, you should have some error output describing the issue in more detail.
May 18, 2016 at 6:30 pm #998314
rosstmParticipantI have done that. But I didn’t say anything about a white screen? The arrows do not appear everything else is fine.
May 18, 2016 at 11:40 pm #998783
RadModeratorHi there,
Your stack is ethos while the code has the condition for integrity. Hence, it will not display. Try changing this line,
if ( $stack == 'integrity' ) {to this,
if ( $stack == 'ethos' ) {It was originally made for ethos, the one you copied could be custom code for integrity.
Thanks!
May 19, 2016 at 11:15 pm #1000881
rosstmParticipantNo my stack is integrity. I have tried both just for fun. Doesn’t work.
Any other ideas?
May 20, 2016 at 12:38 am #1000972
RadModeratorHi there,
In that case, you don’t need to add this custom code. Integrity has its own nav arrows along with the breadcrumbs. But, I just found out that it’s only applicable for the built-in post type and taxonomy.
Some did it here http://stackoverflow.com/questions/10376891/make-get-adjacent-post-work-across-custom-post-types
But that is just for post type’s query, custom taxonomy like portfolio category isn’t even included. Hence, it’s a long customization in which I can’t cover. You may hire a developer that could do it.
This is not a theme limitation, but WordPress’s function limitation ( https://codex.wordpress.org/Function_Reference/get_adjacent_post )
Thanks for understanding.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-995172 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
