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
Related Posts:
- How do I programatically empty trash?
- Primary and Secondary Button Classes
- Show current navigation path from menu
- How to insert a Button or custom text on twentyseventeen header
- Override admin submit_button() functionality
- Remove “Save draft” button without using CSS
- Download a file and scroll to bottom div on button click
- Remove Save Draft & Preview Buttions.. and also Statius: Draft & Visibility: Public
- Add multiple custom buttons with custom links after add to cart button for every product
- Loading elements with a button
- How to align Button on the right of the image on desktop but below the image on mobile
- How can I center the “Buttons” in the WordPresse editor?
- Add button to menu item at the same row
- NavBar Button Clicks (need 2 clicks rather than 1 click)
- Using button from the function submit_button() triggers alert
- Create Button Using Provided Code
- How to add a breadcrumb to WordPress header?
- Page/Post path in Search Results
- Button to execute shorcode [closed]
- PayPal buttons not working after 4.2.4 upgrade
- Button not working?
- submit button not work
- When moving a WP site, why does wp-admin redirect to old site?
- Symbolic Links on dev box with plugins and stylesheets
- Setting a custom sub-path for blog without using pages?
- How i can i add a split button or list box to the WordPress TinyMCE instance
- Absolute Path (ABSPATH) in WordPress is not working
- Custom “Publish” / “Update” button &
- Custom Shortcode and Button not Working after 3.9 update
- Custom Taxonomy Breadcrumb Navigation
- Plugin base URL
- Wrong path for theme assets
- How can I get a link path to use for my resources such as JS scripts?
- Get the posttype of a taxonomy/term
- Header Button Chance Polylang Elementor
- Custom button block doesn’t work
- How to obtain page breadcrumb based on menu structure only?
- Changing the server path
- Get the path of the first attached media (single.php)
- Breadcrumbs on Product Page Always Show Wrong Product [closed]
- Button not refreshing page
- How do I create a custom add media button modal?
- Get posts from taxonomy URL
- How to show only one category in breadcrumb navigation
- How do I test my localhost WordPress project with VirtualBoxVM?
- Custom walker to generate menu with integrated breadcrumb dropdowns
- add media button is not working
- How to Create a Parent of Pages But have it not link yet keep the URL Path?
- Why is server preventing admin styles? (Was: Where are WordPress sessions saved?)
- Customizer AJAX using buttons
- Add custom button next to native “Apply” button in the edit-tag screen
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Using arbitrary paths in page urls
- Multiple category selection in post, shows less important category in breadcrumb
- wp_enqueue_script not loading my custom js file
- AJAX on Front-End Button Click not working – Custom Plugin
- magic “MENU” button under Twenty Twelve theme
- Is there a way to direct unregistered user to registration page when click a link?
- adding a button to the media uploader
- breadcrumb need to show all pages and subpages
- Add custom path to url to specific pages
- Cannot changing login button color, have tried theme, plugins… is it GoDaddy managed?
- Add to Cart button displaying twice on Shop Page Woocommerce
- Plugin path comes wrongly
- What is procedure to let set path in wordpress?
- Edit value=”” of a button in child theme
- how to change the “return to shop” button text? [closed]
- Page menu not showing in admin, new Page button missing in toolbar too
- How to implement custom buttons into individual posts?
- Using breadcrumb to return from single-page to list
- Custom Post Type and Breadcrumbs Conflict
- WordPress VIP realpath Alternative?
- Loading Images from Javascript on the Front End
- How to declare/provide file path in JQuery which is emeeded in the WordPress theme
- Replace image urls(absolute instead of relative) by using filter in single page
- Multiple categories assigned to a single product breaking the breadcrumb
- URL redirection
- how give a link to an Elementor Pro widget with variable part
- Link custom post type to parent page and show in slug / breadcrumb
- How to add woocommerce products header title in woocommerce_breadcrumb hook to function.php
- Add a product category to a specific product via a button
- Yoast breadcrumb URL shows category instead of the page
- How can I change page content for good once a button is pressed?
- How to edit button permalink inside function.php using a child theme?
- Can’t get parent page id
- How to execute certain code on back-end button press?
- Make Woocommerce breadcrumbs show up using functions.php file
- Right path for renaming a file in uploads folder
- Creating a simple button inside of a widget
- WooCommerce breadcrumb display custom posts instead of product data
- Rewritten URL not loading WordPress environment
- Codex Function Problems When There is an Apostrophe in the Category Name
- Image paths on custom post types getting /post_type/ added to path
- Functions are causing errors
- Taxonomy term breadcrumb; how?
- Use radio buttons & checkboxes for post categories
- just show the field comment by clicking button
- Rename woocommerce button [closed]
- How can i add a random redirect button in wordpress? [closed]
- WP-DBManager Plugin Can’t Find Mysql Path