Tagged: x
-
AuthorPosts
-
April 22, 2016 at 5:23 am #895107
CrikeyMateParticipantHello!
Two things, really.
First of all, as the thread title says; Buttons. The forward and next buttons, as on Ethos posts. How do I also display these buttons on Mobile devices.
Secondly, how do I get those said buttons (On desktop and mobile) to display ONLY posts from with the current Posts category. I read and used another posts’ solution on here (from 2014), but the little arrow indicator inside the button disappeared when I did.
Actually, ONE more thing whilst I am here;
I am having random 400 errors on some images. This is not an X problem, per se, but I am hoping you can assist me, because everything I’ve tried has failed. My question is;
How can I use a random/default image to replace the 400 erroneous images? For example, if a certain post gets a 400 error, instead of displaying the little icon that shows “error”, can I instead show a default image? If so, pleassssse tell me.
Thanks all for now. 🙂
April 22, 2016 at 5:23 am #895108
CrikeyMateParticipantThis reply has been marked as private.April 22, 2016 at 8:50 pm #896140
RadModeratorHi there,
Thanks for writing in.
Not sure if it’s really possible as I never tried it before, but according to this https://codex.wordpress.org/Function_Reference/previous_post_link
https://codex.wordpress.org/Function_Reference/get_adjacent_postin_same_term
(boolean) (optional) Indicates whether previous post must be within the same taxonomy term as the current post. If set to ‘true’, only posts from the current taxonomy term will be displayed. If the post is in both the parent and subcategory, or more than one term, the previous post link will lead to the previous post in any of those terms.It’s WordPress’s feature, and not something added by the theme. But we do only integrated it into the design.
Let’s try this, please add this code to your child theme’s functions.php
function x_entry_navigation() { $stack = x_get_stack(); if ( $stack == 'ethos' ) { $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 }Then please add this CSS to Admin > Appearance > Customizer > Custom > Gobal CSS as well
@media (max-width: 767px){ .single-post .x-nav-articles { display: block; float: none; margin: 0px auto 20px; clear: both; width: 82px; } }And I’m not getting any 400 Bad Requests on my end. Would you mind providing the exact URL?
Thanks!
April 23, 2016 at 6:40 am #896562
CrikeyMateParticipantWorked like a charm. You’re a legend, Rad.
One other thing; Can the Next & Previous buttons show a “random” post from said category? As opposed to simply via Date.
As for the 400 error. It’s quite random, and I deleted the posts it was affecting. Though, it’ll happen again in the future I am sure. Is there a “generic” code I could use in the event it happens again?
April 24, 2016 at 4:02 pm #897730
RadModeratorHi there,
There is no code and it’s more related your hosting’s setting or limitation. For example, it has a limit for the connection’s it can serve a session. It’s best to contact your hosting provider it this issue comes` again.
Thanks!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-895107 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
