Support » Plugin: Random Post Plugin - Redirect URL to Post » Next and Prev not working with custom post type

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Chris

    (@camthor)

    Hi,

    In the links you sent above you forgot to use a post as the starting point. Since “previous” and “next” define a relation, the plugin needs to know what the target should be previous or next to.

    Please try

    https://ultimateshop.fun/webcomic/cheese-subscription/?redirect_to=prev

    and

    https://ultimateshop.fun/webcomic/cheese-subscription/?redirect_to=next

    (No need to add post_type since the plugin can infer it from the post which you apply the link on.)

    If you want to insert these links on a page where you display the posts, it is sufficient to use ?redirect_to=prev or ?redirect_to=next – the browser adds the left part of the URL for the current post.

    Thread Starter dg2300

    (@dg2300)

    Hi Chris,

    Thanks for you reply, much appreciated.

    I’ve got the links on buttons built into a template, so I was hoping it would be relative to the post it was on. Is this just not going to work?

    I’m using Beaver Builder Themer to build the template, if it helps.

    Plugin Author Chris

    (@camthor)

    It works if you use as links in the buttons the relative address format – ?redirect_to=prev or ?redirect_to=next.

    On your website the ?redirect_to=prev and next is added to the root, without the URL part for the post. For example: https://ultimateshop.fun/?redirect_to=next When I inspect the HTML, I see a slash:

    <a href="/?redirect_to=next" target="_self" class="fl-button" role="button">
     <span class="fl-button-text">Next Big Thing ></span>
    </a>

    So please make sure that you don’t use a slash (“/”) in front of the question mark in the link for the button.

    Thread Starter dg2300

    (@dg2300)

    Oh jeez, you’re right. Thanks so much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Next and Prev not working with custom post type’ is closed to new replies.