Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1248084
    JfantasyBooks
    Participant

    Hey 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.3

    Problem:

    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

    }

    #1248255
    Christopher
    Moderator

    Hi 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.

    #1249569
    JfantasyBooks
    Participant

    Yes. 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?

    #1249693
    Rupok
    Member

    Hey 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.

    #1250748
    JfantasyBooks
    Participant

    Well 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?

    #1251114
    Lely
    Moderator

    Hello There,

    Yes, please check this link:https://community.theme.co/custom-development/

    #1252894
    JfantasyBooks
    Participant

    The 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?

    #1252980
    Rue Nel
    Moderator

    Hello 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.

    #1253048
    JfantasyBooks
    Participant

    you 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.

    #1253168
    Rue Nel
    Moderator

    Hello 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.

    #1253380
    JfantasyBooks
    Participant

    Yes, 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.

    #1253838
    Rad
    Moderator

    Hi 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.

    #1259278
    JfantasyBooks
    Participant

    Thanks!

    #1259394
    Rahul
    Moderator

    You’re welcome!

    Let us know if we can help with anything else.

  • <script> jQuery(function($){ $("#no-reply-1248084 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>