Tagged: x
-
AuthorPosts
-
November 7, 2016 at 9:30 pm #1248084
JfantasyBooksParticipantHey there, Themeco Team!
Name: JFantasyBooks
Site: Fantasy-Books
Site Url: https://fantasy-books.live
WordPress Version: 4.6.1
X Version: 4.6.4
Cornerstone Plugin Version: 1.3.3Problem:
So I have this in my functions.php (what is seen below) allowing the icon icon to go to the next and previous posts within that same category. Meaning, if you are observing a post of a particular category, when you click, let’s say, the right arrow, you will go to the next post of that same said particular category.
The problem I have is, I want to put this on the end of the post above the comment section.
But instead of icons, I want to use the theme’s buttons where it would be labeled as Previous Chapter, Index, and Next Chapter.
The Previous Chapter is like the Left Icon in the php below; The Next Chapter is like the Right Icon in the php below, and the Index is just linked to a particular post on the site. This is all by category.
Can you give me an outline on how to do this?
Thanks.
PHP
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, ”, true );
$next_post = get_adjacent_post( true, ”, false );
$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 ) : ?>
” title=”<?php __( ‘Previous Post’, ‘__x__’ ); ?>” class=”prev”>
<?php echo $prev_icon; ?>
<?php endif; ?><?php if ( $next_post ) : ?>
” title=”<?php __( ‘Next Post’, ‘__x__’ ); ?>” class=”next”>
<?php echo $next_icon; ?>
<?php endif; ?></div>
<?php
}
November 8, 2016 at 12:59 am #1248255
ChristopherModeratorHi there,
You’ve already achieved it, to move navigation to bottom of page, please add following code in Customize -> Custom -> Global jQuery :
jQuery(".x-nav-articles").prependTo("#comments");Please add following code in Customize -> Custom -> Global CSS :
.x-nav-articles { width: 80%; margin: 0 auto; outline: 1px solid; display: block; }In regards with Index link, 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 may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Hope it helps.
November 8, 2016 at 9:52 pm #1249569
JfantasyBooksParticipantYes. So,the thing is, I don’t want to actually use the navigation icons, but instead use x theme buttons where I of a particular text to my liking
Is that possible?
November 9, 2016 at 1:27 am #1249693
RupokMemberHey there,
Thanks for writing back! It would be possible through custom development. Regretfully, this particular customization request is outside the scope of our support as this is not related to an issue with the theme and instead has to do with your customization of it. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself. If you have any further questions about the theme, we are more than happy to provide you with assistance on these inquiries.
Thank you for your understanding.
November 9, 2016 at 5:20 pm #1250748
JfantasyBooksParticipantWell since this is in regards to the x theme, does x theme offer paid custom development services, even if it is not on a huge project like building the entire site?
November 9, 2016 at 10:20 pm #1251114
LelyModeratorHello There,
Yes, please check this link:https://community.theme.co/custom-development/
November 11, 2016 at 1:05 am #1252894
JfantasyBooksParticipantThe Jquery code/ css you gave me above.
1. I would like the navigation to be at the center of the bottom. Can you show me how? No matter what I change, it remains at the far left.
2. Is there a way of putting it at the end of the page content, but above any plugins like the ‘likes’ button you see from jetpack?
November 11, 2016 at 2:29 am #1252980
Rue NelModeratorHello There,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
Thank you.
November 11, 2016 at 3:33 am #1253048
JfantasyBooksParticipantyou can use: https://fantasy-books.live/the-abandoned/the-abandoned-chapter-3-pain/
Any post would follow. I am using php, and would like the buttons to appear immediately below the content, but above the jetpack ‘like’ buttons. I would like it just right below the content itself.
November 11, 2016 at 5:10 am #1253168
Rue NelModeratorHello There,
How did you add this block? Do you have a function in your child theme’s functions.php file? If you are using the add_action(), you will need to prioritize it so that it will be added first. For example;
add_action('the_content', 'the_function_for_your_next_prev_buttons', 5)The # 5 indicates the priority number. It is safe to have 5 and if still it doesn’t comes first, please try 1 or 2 to be sure. For more details about how you can prioritize an action, please check out the codex: https://developer.wordpress.org/reference/functions/add_action/
Hope this helps.
November 11, 2016 at 9:04 am #1253380
JfantasyBooksParticipantYes, after a few hours, I finally figured it out and placed it as a function through my child’s theme.
I tried using your what you suggested and I ended up with 5 buttons above my navbar and all my content gone.
What I makes it look like you see now is the add_action(‘x_before_the_content_end’, ‘the_function_for_your_next_prev_buttons’);
But once I use add_action(‘the_content’, ‘the_function_for_your_next_prev_buttons’, 5) it doesn’t work at any priority. I even tried 100. There was no change.
I tried using the priority for x_before_the_content_end, but there was no difference from what you see now.
November 11, 2016 at 5:09 pm #1253838
RadModeratorHi there,
You can change the javascript code to this
jQuery(".single-post .x-nav-articles").prependTo(".sharedaddy");Then change the arrow icons to text like by adding this code to your child theme’s functions.php
function x_entry_navigation() { $stack = x_get_stack(); if ( $stack == 'ethos' ) { $left_icon = 'Previous Chapter'; $right_icon = 'Next Chapter'; } else { $left_icon = 'Previous Chapter'; $right_icon = 'Next Chapter'; } $is_ltr = ! is_rtl(); $prev_post = get_adjacent_post( false, '', false ); $next_post = get_adjacent_post( false, '', 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 }Hope this helps.
November 16, 2016 at 7:01 am #1259278
JfantasyBooksParticipantThanks!
November 16, 2016 at 8:41 am #1259394
RahulModeratorYou’re welcome!
Let us know if we can help with anything else.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1248084 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
