Need help editing function
-
I have a code snippet which I placed in my functions.php The function adds next/previous to posts using shortcodes
here is the code
add_shortcode( 'prev', 'prev_shortcode' ); add_shortcode( 'next', 'next_shortcode' ); function next_shortcode($atts) { global $post; ob_start(); next_post_link( '<div class="nav-next">%link</div>', 'Next post link' ); $result = ob_get_contents(); ob_end_clean(); return $result; } function prev_shortcode($atts) { global $post; ob_start(); previous_post_link( '<div class="nav-previous">%link</div>', 'Previous post link' ); $result = ob_get_contents(); ob_end_clean(); return $result; }
What I want to do is edit this code so it only cycles through one category in date order which I assume is default anyway. I am limited in my ability with php so I need help to accomplish what I want. can anyone help?
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
- The topic ‘Need help editing function’ is closed to new replies.