Use Arrows for Post Navigation and limit to category

Community Forums Forums General Discussion Use Arrows for Post Navigation and limit to category

This topic is: not resolved

This topic contains 2 replies, has 2 voices, and was last updated by  Amy Kvistad 1 year, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #49499

    Amy Kvistad
    Participant
    Post count: 12

    I would like to hide my post titles and just use an arrow to navigate between posts. If I remove the title then I am also removing the link! I would also like to limit the navigation to within the same category.

    Thanks for the help!
    ~Amy

    #49523

    ramseyp
    Participant
    Post count: 99

    Hi Amy,

    I did something like this once. In this case, above the post title itself, I wanted the arrows to show. In my child theme’s functions.php, I wrote this:

    
    /**
     * Single Post next/prev links
     *
     */
    function s25_prev_next_post_nav() {
    	if ( ! is_singular( 'post' ) )
    		return;
    	?>
    	<div class="navigation">
    		<div class="prev"><?php previous_post_link('%link', '&laquo;', TRUE); ?></div>
    		<div class="next"><?php next_post_link('%link', '&raquo;', TRUE); ?></div>
    	</div>
    	<?php
    }
    add_action( 'genesis_before_post_title', 's25_prev_next_post_nav' );

    • This reply was modified 1 year, 5 months ago by  ramseyp.
    • This reply was modified 1 year, 5 months ago by  ramseyp.
    #49739

    Amy Kvistad
    Participant
    Post count: 12

    Hi, this is great and works well. I added background color and pulled them off to the sides of the browser. One more thing I would love to fix and can’t figure out is 1) how to hide the link of it is the first/last one, or 2) link to the first/last post so there is a continual loop.

    http://amykvistad.com/web/website-push-ad-design/

    Thanks!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.