-1

I must add back button only on one page and only when I get to this page from one specific.

If I on B Page and go to A Page -> display button od A Page but if I on C Page and go to A Page - button should be hidden on A Page.

How can I do that?

Second question. How can I make breadcrumbs for one specific page? I have some section on page and I need path to follow them. User should can choose at any time from this list interesting section.

Thanks for help

1

For the button behavior,

If it's a one-off use case, you could add custom php conditional to check the referring url $_SERVER['HTTP_REFERER'] and current page/post ID or url. Then, either add a class to the button's containing div wrapper in the template for hiding via css or directly output/include the button html in the template file itself.

If it applies for various cases, I'd recommend creating an array of 2-d arrays (referrer url or post id, target url or post id). Then use (setting/checking) a session cookie to loop through the array to see if any conditions are satisfied and in turn, show or hide button

  • Thx, I try it :) – Silva Oct 14 '17 at 7:23

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.