0

Could you please help me understand if we can create a shortcode to move on to next page.

For example, I will have a short code "GO_NEXT_PAGE", which will help me to go from post mydomain.com/test_post to mydomain.com/test_post/2.

For example you can check this page. I will click on "SHOW_ME_ANSWER" and this will take me to this page

0

It's not completely clear what you want to do, but it looks like you're looking for the built in <!--nextpage--> shortcode, which allows you to cut a post in two or even more pieces.

If you control your theme you can style wp_link_pages to change the link from the default 'next page' to something like 'Show me the answer'. Or you can use a filter to do even more complicated stuff.

Alternatively, there's all kinds of plugins, of course.

  • Thanks,But that is not I want. I want to a short code, which will help me to move next page. I am aware about <!--nextpage--> but only at some instance i want to use short code "SHOW_ME_THE ANSWER" for visitors to move the next page. at any other instance they can still navigate to different sub pages 2/3/4/5 and so on... – Avinash Patel Jan 30 '17 at 17:27
  • The example you give links to /2/, which is the same as subpage 2 you are referring to. If you only want a different name of the link in some cases, use a filter. – cjbj Jan 30 '17 at 18:56
  • I am using subpages for many other purposes not every time subpage/2/ has the answer. I want to use short code 'SHOW_ME_ANSWER' only when the next page has answer. I am already asking user to move to next page to see the answer and giving link of subpage manually, however i wanted to make it shortcode if possible so that i jst type the shortcode and upon cliking on that by user will move them to next page to show answer. – Avinash Patel Jan 31 '17 at 3:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.