badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

Limiting 'previous' and 'next' post links to stay within categories

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2966
    lisapieca
    Member

    Hi –

    We are using a number of different galleries (just the basic wordpress ones) on our site that mimic our ‘post categories’ and we want to restrict the previous / next post links to stay within a particular category.

    I’ve found a couple of threads in other forums that indicate this is possible eg

    http://codex.wordpress.org/Function_Reference/previous_post_link
    http://wordpress.stackexchange.com/questions/63689/next-previous-links-doesnt-work-in-the-same-category

    but can’t find where / how I make these edits in attitude pro.

    Would love it if you could point me in the right direction.

    cheers

    lisa

    #3003
    Sanjip Shah
    Participant

    @lisapieca I could completely get what you are trying to do. Are you trying to hide the next/previous post link in some pages?
    Could you clarify it more and provide the exact page/pages where you are trying to make the changes.

    #3034
    lisapieca
    Member

    Sorry that I wasn’t clear.

    I have built a site for an artist – http://www.artplusdesign.com.au and have sorted his artwork (each work has its own post) into a number of different categories:

    * conceptual art
    * public art > street furniture
    * public art > kinetic art
    * public art > playgrounds
    * public art > community art

    Anytime you view one of the artwork posts it gives you the option to move to the previous or next artwork at the bottom of the post by creating a link/button with the title of the post you are linking to as the text.

    This is great, except that the way it decides what is next/previous is based on the date the post was created, so it jumps outside of the category. We would like to limit the next and previous links to stay within the category.

    I have found information in forums where others have done this (see above) but I can’t find where in the attitude theme files that I make the edits they suggest.

    cheers

    lisa

    #3049
    Sanjip Shah
    Participant

    @lisapieca The code that you should edit is inside the theme folder->library folder->structure folder->content-extensions.php The related code is inside attitude_next_previous_post_link function in line around 798. Hope this helps you and also make a child theme for this customization so that you won’t lose the changes when you update the theme. Thanks.

    #3153
    lisapieca
    Member

    thanks 🙂

    #3172
    Sanjip Shah
    Participant

    @lisapieca Welcome! 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.