Last active
February 12, 2021 03:12
-
-
Save askwpgirl/60173fb9c25dadf010bee2270a8935a0 to your computer and use it in GitHub Desktop.
Shortcode for Loop Posts Navigation Links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// copy below to child theme's functions.php or Code Snippets plugin. Do not need leading <?php above | |
/*-------------------------------------------------------*/ | |
/* Creating Shortcode for Navigation Loop | |
/* Requires https://wordpress.org/plugins/loop-post-navigation-links/ | |
/* Place [loop_post_nav] shortcode in Shortcode widget in Elementor Single Post Template | |
/*-------------------------------------------------------*/ | |
function loop_nav() { | |
?> | |
<div class="loop-navigation"> | |
<div class="alignleft"><?php c2c_previous_or_loop_post_link(); ?></div> | |
<div class="alignright"><?php c2c_next_or_loop_post_link(); ?></div> | |
</div> | |
<?php | |
} | |
function loop_nav_shortcode($atts) { | |
$atts = loop_nav(); | |
return $atts; | |
} | |
add_shortcode( 'loop_post_nav', 'loop_nav_shortcode' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment