Okay
  Public Ticket #1358853
previous/next post navigation
Closed

Comments

  • Txussa started the conversation
    Hi. My website is a travel diary. I need to change the position of the navigation labels "older post / next post" so that "next post" appears on the right side of the page. Regards

    {"wp":{"use":false,"adminUrl":"","username":"","password":""},"ftp":{"use":false,"url":"","port":"","user":"","password":"","path":""}}

  • [deleted] replied

    Hi there,

    Before your continue with further steps please consider reading the article we wrote about How to Add Custom Code to your site. Then please past the code below in function.php

    remove_action('kalium_blog_single_post_details_after','kalium_blog_single_post_prev_next_navigation', 20);
    add_action( 'kalium_blog_single_post_details_after', 'kalium_blog_single_post_prev_next_navigation_custom', 31 );
    if (! function_exists('kalium_blog_single_post_prev_next_navigation_custom')) {
        function kalium_blog_single_post_prev_next_navigation_custom(){
            if ( kalium_blog_get_option( 'single/prev_next' ) ) {
                // Args
                $args = array();
                $adjacent_post_args = apply_filters( 'kalium_blog_single_post_prev_next_navigation', array(
                    'return' => 'id',
                    'loop' => true
                ) );
                $prev_id = next_post_link_plus( $adjacent_post_args );
                $next_id = previous_post_link_plus( $adjacent_post_args );
                // Previous link
                if ( $prev_id ) {
                    $prev = get_post( $prev_id );
                    $args['prev'] = $prev;
                    $args['prev_title'] = __( 'Newer Post', 'kalium' );
                }
                // Next link
                if ( $next_id ) {
                    $next = get_post( $next_id );
                    $args['next'] = $next;
                    $args['next_title'] = __( 'Older Post', 'kalium' );
                }
                kalium_get_template( 'global/post-navigation.php', $args );
            }
        }
    }

    If you have any trouble with code let us know, we might help you further steps.

    Thank you.

  • Txussa replied

    Hello again
    I pasted the code in functions.php in the child kalium theme. The problem now is that the new order of the post appears but also the old one.
    http://cuentoviajes.com/dia-3-insectos-tropicales-y-playa-bayahibe/
    Regards
  • [deleted] replied

    Hi Texussa,

    Can we try this one below :

    remove_action('kalium_blog_single_post_details_after','kalium_blog_single_post_prev_next_navigation', 20);
    add_action( 'kalium_blog_single_post_details_after', 'kalium_blog_single_post_prev_next_navigation_custom', 99 );
    if (! function_exists('kalium_blog_single_post_prev_next_navigation_custom')) {
        function kalium_blog_single_post_prev_next_navigation_custom(){
            if ( kalium_blog_get_option( 'single/prev_next' ) ) {
                // Args
                $args = array();
                $adjacent_post_args = apply_filters( 'kalium_blog_single_post_prev_next_navigation', array(
                    'return' => 'id',
                    'loop' => true
                ) );
                $prev_id = next_post_link_plus( $adjacent_post_args );
                $next_id = previous_post_link_plus( $adjacent_post_args );
                // Previous link
                if ( $prev_id ) {
                    $prev = get_post( $prev_id );
                    $args['prev'] = $prev;
                    $args['prev_title'] = __( 'Newer Post', 'kalium' );
                }
                // Next link
                if ( $next_id ) {
                    $next = get_post( $next_id );
                    $args['next'] = $next;
                    $args['next_title'] = __( 'Older Post', 'kalium' );
                }
                kalium_get_template( 'global/post-navigation.php', $args );
            }
        }
    }

    Thank you.

  • Txussa replied

    it doesn´t work. It still appears twice.. 

    Regards

  • [deleted] replied

    Hi Txussa,

    Can you please share with us your FTP and WP Credentials, we have to look from close view.

    To include your credentials click Insert Credentials button in editor toolbar. (See how)

    Thank you.