• Resolved cacatalano

    (@cacatalano)


    Is it possible to change how the the next and previous navigation links display in the post? Specifically, when a viewer browses to the first post from an image in the gallery page, the navigation links seem to be backwards. It would be more intuitive for the viewer to see a ‘next’ link in the first post rather than the ‘previous’. I hope I am making myself clear. Basically, I am trying to make this an image gallery rather than a blog that shows posts last to first. Check out https://jbarthes.com/index.php/category/informal-algorithm-2015/ Thank you for your help on this.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Theme Author GavickPro

    (@gavickpro)

    Hello,

    Please change in the single.php file the following code:

    <?php
    		previous_post_link(
    			'<div id="prev-post">%link</div>',
    			'<i class="fa fa-arrow-left"></i>',
    			(get_theme_mod('portfolio_show_post_navigation_same_taxonomy', '0') == '0' ? FALSE : TRUE)
    		);
    	?>
    	<?php
    		next_post_link(
    			'<div id="next-post">%link</div>',
    			'<i class="fa fa-arrow-right"></i>',
    			(get_theme_mod('portfolio_show_post_navigation_same_taxonomy', '0') == '0' ? FALSE : TRUE)
    		);
    	?>

    to:

    <?php
    		previous_post_link(
    			'<div id="next-post">%link</div>',
    			'<i class="fa fa-arrow-right"></i>',
    			(get_theme_mod('portfolio_show_post_navigation_same_taxonomy', '0') == '0' ? FALSE : TRUE)
    		);
    	?>
    	<?php
    		next_post_link(
    			'<div id="prev-post">%link</div>',
    			'<i class="fa fa-arrow-left"></i>',
    			(get_theme_mod('portfolio_show_post_navigation_same_taxonomy', '0') == '0' ? FALSE : TRUE)
    		);
    	?>
    Thread Starter cacatalano

    (@cacatalano)

    That worked great!! Thank you again for this wonderful theme.

    Thread Starter cacatalano

    (@cacatalano)

    done

    Theme Author GavickPro

    (@gavickpro)

    Thank you – please rate our theme when you finish your work ??

    Hi Gavick,

    Can you please clarify how I can correctly add your php code to my child theme? I cut and pasted your code into my child theme php and it took my whole site down until I restored original php, so clearly I did it wrong. Any suggestions would be greatly appreciated. Thank you!!
    lisanugget.com

    (my code starts here)
    <?php
    // Exit if accessed directly
    if ( !defined( ‘ABSPATH’ ) ) exit;

    // BEGIN ENQUEUE PARENT ACTION
    // AUTO GENERATED – Do not modify or remove comment markers above or below:

    if ( !function_exists( ‘chld_thm_cfg_parent_css’ ) ):
    function chld_thm_cfg_parent_css() {
    wp_enqueue_style( ‘chld_thm_cfg_parent’, trailingslashit( get_template_directory_uri() ) . ‘style.css’ );
    }
    endif;
    add_action( ‘wp_enqueue_scripts’, ‘chld_thm_cfg_parent_css’ );

    (your code inserted here)

    <?php
    previous_post_link(
    ‘<div id=”next-post”>%link</div>’,
    ‘<i class=”fa fa-arrow-right”></i>’,
    (get_theme_mod(‘portfolio_show_post_navigation_same_taxonomy’, ‘0’) == ‘0’ ? FALSE : TRUE)
    );
    ?>
    <?php
    next_post_link(
    ‘<div id=”prev-post”>%link</div>’,
    ‘<i class=”fa fa-arrow-left”></i>’,
    (get_theme_mod(‘portfolio_show_post_navigation_same_taxonomy’, ‘0’) == ‘0’ ? FALSE : TRUE)
    );
    ?>
    (your code ends here)
    // END ENQUEUE PARENT ACTION

    Theme Author GavickPro

    (@gavickpro)

    Where did you pasted my code? It must be replaced in the single.php file in your child theme.

    I am using Child Theme Configurator v.1.7.5.1. This plugin allows me to add code to my child theme php file from the dashboard > appearance > editor. This is where I added your code, unsuccessfully. Is there is any way to use Child Theme Configurator for this edit?

    I can manually edit the single.php code in my parent gk-portfolio theme, but will this edit survive future upgrades?

    Thank you for your help!

    NB

    Theme Author GavickPro

    (@gavickpro)

    We didn’t use this kind of extension, but if you have a separate directory for child theme, then please just copy there the single.php file and then modify it – then it will survice the updates.

    I added the edited single.php to my child theme via ftp. Works great!! Thank you!!
    NB

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Post display order in gallery’ is closed to new replies.