[Resolved] How Do I Create Next – Previous Article Links

Home Forums Support [Resolved] How Do I Create Next – Previous Article Links

Home Forums Support How Do I Create Next – Previous Article Links

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1040959
    Robin

    Hey there,

    I must be blind today because I can’t for the life of me figure out how to create/show Next and Previous article links at the bottom of each blog post.

    I’d love it if they could look something like this:
    https://www.screencast.com/t/lhPoMCXgdfy

    Could you let me know? Many thanks.

    Robin

    #1041214
    David
    Staff
    Customer Support

    Hi there,

    in Customizer > Layout > Blog –> Select Singles Tab and then check: Display post navigation

    Once thats active try this CSS:

    .nav-previous .prev:before {
        content: 'Previous Article';
    }
    
    .nav-next .next:before {
        content: 'Next Article';
    }
    
    .nav-previous .prev:before,
    .nav-next .next:before {
        width: auto;
        display: block;
        font-family: inherit;
        text-align: left;
        margin-right: 0;
        margin-bottom: 0.5em;
        margin-top: 1.5em;
    }
    
    @media (min-width: 769px) {
        .nav-next .next:before {
            text-align: right;
        }
    
        .post-navigation {
            display: flex;
            justify-content: space-between;
        }
    }
    #1041220
    Robin

    Thanks, David. That worked. Cheers – Robin

    #1041239
    David
    Staff
    Customer Support

    Glad to be of help – looks great.

    #1360719
    Robin

    Is there a way to make the next/previous article like only show articles within a specific category.

    Example: Visitor is viewing an article in the ‘Recipe’ category. I only want Next/Previous articles to be from the ‘Recipe’ category.

    Likewise, if someone is looking at a video in the ‘Video’ category, I only want Next/Previous articles to be from the ‘Video’ category.

    Is there a way to do this?

    Cheers.

    #1361183
    Leo
    Staff
    Customer Support
    #1361213
    Robin

    Hi Leo,

    I have added this code and activated it:

    add_filter( 'generate_category_post_navigation', 'article_navigation_category_specific' );
    function example_function_name()
    { 
        return 'Your new value';
    }

    Seems the full code doesn’t show. Here’s a screenshot – https://www.screencast.com/t/Cmp4XTWY

    And it doesn’t seem to work. Still shows articles from other categories.

    #1361296
    Tom
    Lead Developer
    Lead Developer
    #1361331
    Robin

    That worked, Tom. Many thanks.

    #1362192
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

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