Removing single post navigation

  • lizruest

    #4020

    I had been removing single post navigation (post-nav @ the top of the post) in prior updates, and haven’t invested time in figuring out how to do it in my child theme. Removing all post-nav display is not what I’m looking for.

    Code I was commenting out from loop.php, within an IF statement for single posts that are not a page:

    <div class="post-nav clearfix">
    <p id="previous"><?php previous_post_link(); ?></p>
    <p id="next-post"><?php next_post_link(); ?></p>
    <?php do_action( 'graphene_post_nav' ); ?>
    </div>

    The same block of code seems to now be in loop-post-formats.php, but commenting it out from the new location doesn’t seem to do the trick any more.

    Thoughts? Would be happy to add it to my child theme code if it’s not too tricky, but it seemed buried pretty deep, and beyond the time I volunteer to maintain the site it’s for. Thanks for any advice.

    Mod

    Kenneth John Odle

    #26988

    No need to hack into theme files (either with previous versions of theme or the current one). Just add this to your custom css:

    #previous, #next-post {display:none;}

    lizruest

    #26989

    Thanks. I’d love a solution that is in the child theme. This suggestion appears to remove ALL post navigation in lists as well as single posts.

    Trying to hide just the top navigation on a single post, not the bottom navigation in lists. Appreciate any suggestions.

    Mod

    Kenneth John Odle

    #26990

    not the bottom navigation in lists.

    Can you show me an example of this?

    lizruest

    #26991

    Sure. On the site I help maintain (www.arteast.org), click any post title, such as the one featured on the front page. In single-post view, the gray area on top now references two posts that are related only by post date. I want that area to disappear.

    On the other hand, if I’m looking at a list (Workshops/All Workshops or Gallery/On Display), and scroll to the bottom, I do want there to be a navigation button to generate the next page in the list.

    When I use a straight-out display:none entry in the child CSS, both of those navigation areas disappear.

    As I mentioned originally, I was getting that effect by removing a few lines in loop.php, inside an IF statement for single posts that aren’t pages. I agree that it wasn’t the best solution, but can’t find the equivalent solution in the updated theme code, and would love to know if there’s an easy way to do it in a child theme.

    Thanks for taking a look!

    Mod

    Kenneth John Odle

    #26992

    So I’m looking at http://arteast.org/category/workshops/page/2/ and there is “<<More” and “More>>” at the bottom, both of which use the same ID’s. I did not know that Graphene did this.

    The good news here is that Graphene natively supports the WP-PageNavi plugin. If you use that plugin, you can keep the above code. You can see an example of the plugin at work on the main page of either of my blogs, or on a category page here:

    http://bookblog.kjodle.net/category/book-review/page/2/

    lizruest

    #26993

    Gotcha. Hide Graphene’s post navigation completely and use a separate plugin for just the bottom of lists. Sorry to hear that’s how it has to be. I do like the look of that plugin. Thanks.

    I guess using different classes for the top & bottom/post & list nav would be the eventual way to go…

    Mod

    Kenneth John Odle

    #26994

    Feel free to add that as a feature request: https://forum.graphene-theme.com/feature-requests/

    Admin

    Syahir Hakim

    #26996

    You can use the .single class:

    .single .post-nav {
    display: none;
    }

    ABID KHAN

    #26997
    Quote:
    You can use the .single class:

    .single .post-nav {

    display: none;

    }

    Brother where should I paste this code? I’ve the same problem.

Viewing 10 posts - 1 through 10 (of 11 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!