The cookie is stored on the user’s computer. The page is generated on the server. Somehow, you must make sure the cookie is transported back to the server when the user clicks on a link to fetch a second page.
The instrument for this is javascript. You must send a script with the page that reads the cookie and adds the cookie content as a query_var
to any internal link, so when it is clicked the query_var
is sent to the server.
-
Make the script to read the cookie. I trust you have already done
this. -
In your theme, make sure all internal links have a class
that you can use to trigger a script that will in turn trigger the
cookie script and add thequery_var
to the url.
I realise this answer is incomplete in terms of code, but I hope you get the idea.
Related Posts:
- How to override functions.php in child theme?
- Overriding core functions in child theme
- Change parent theme file function in child themes functions.php
- Overwrite Parent Theme add_image_size in Child Theme
- Language switcher for subdomains
- Load a Child Theme’s style.css just before the closing tag
- Why functions metaboxes is causing White Screen in Admin [closed]
- Setcookie not setting cookies anywhere except admin
- get_template_directory_uri pointing to parent theme not child theme
- How to customize the_archive_title()?
- How to override parent functions in child themes?
- remove_action on after_setup_theme not working from child theme
- Issues with title-tag and document_title_parts
- Why isn’t is_page working when I put it in the functions.php file?
- Adding a second email address to a completed order in WooCommerce [closed]
- Get the ID of the page a menu item links to?
- Child theme – Overriding ‘require_once’ in functions.php
- Is it ok to use a function to output the text domain name in a wordpress theme
- Include files in child theme functions file
- Display random categories on the front page (Finding and Editing Theme Functions)
- Redeclare a function in a child theme
- How to override a function when isn’t at functions.php
- How to get woocommerce inventory status [closed]
- Child theme functions.php do I use php open and close tags?
- Disable visual editor on one specific page
- Declaring an instance of class included in parent theme from child theme functions.php
- TinyMCE custom styles remove class when switching styles
- One Child Functions.php for Multiple Child Themes
- Extending auth_cookie_expiration based on user role
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- Removing custom background and header feature in child theme
- How can I programmatically create “child” pages on theme activation?
- How to override function in functions.php of parent theme?
- How to edit bbPress template files – WordPress + BuddyPress + bbPress? [closed]
- Implementing DNS Prefetching with WordPress
- override parent theme configuration in child functions.php
- Child theme – overriding add_image_size by a child theme [duplicate]
- Show/hide Widgets in Dashboard Based on Current Advanced Custom Fields Option
- syntax for remove_filter in parent theme with class
- Is it possible to override this function/class in a child theme?
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Organize functions.php
- How to display error messages using WP_Error class?
- Hard Code Pages into a Theme for a Network (multisite) Installation
- Slugs as breadcrumbs for Pages
- Check if has any sidebar active on current page
- Override parent theme function that is not hooked or in the functions.php file
- Remove Page Title from Static Frontpage
- Function in Child Theme not overriding Parent Theme function [duplicate]
- Target a certain page within wordpress backend (admin) i.e. Pages > About
- Adding extra SVGs to TwentyNineteen child theme using class TwentyNineteen_SVG_Icons
- Breadcrumb how i can display page title with parent > child title with permalink ? any Idea
- Reuse variable in hook callback
- Child theme – copied some files from parent to child website still uses parent files
- Add inline css to theme
- Dequeue Scripts and Style for Mobile not working?
- How to override filter in child theme?
- I created a child theme and it doesn’t work for some of the css files
- add sidebar area to header of child theme
- Unregister Nav Menu with fallback?
- Understanding WordPress child theme custom JS loading
- Child Theme Not Overriding Parent Theme
- Displaying Widgets
- Changes to functions.php not working
- Pages should have priority when using add_rewrite_rule
- Setting cookies in WordPress
- Overriding methods in a child theme
- How to override enqueued styles using a child theme
- Should I ask a theme developer to use locate_template rather than require_once
- Nesting Functions within Functions
- Enqueuing Script in functions.php vs on the page
- Dequeue script in template isn’t working
- Programmatically set page template based on page ID
- Using the child theme functions.php to change the customizer.php on parent theme
- Add external js file to footer with id
- Changing itemprop from logo to image on custom logo?
- Child theme functions.php not executing
- How to add background image control to page admin controls?
- How to store / access files in child theme folder
- Delete pages and Create default pages for all new network sites
- Make “sidebar template” the default template for new pages
- override parent theme configuration in child functions.php
- Best Practice for Syncing Local Development With Staging Development [closed]
- wp_enqueue JavaScript in child-theme (ReferenceError) using Search & Go
- how to change link of some wordpress pages
- Make menu structure match page heirarchy on page parent change
- Show excerpt for only first post in query
- How to add css class to image attached in all the posts?
- Change the slug of a particular page every x hours
- Proper way of using functions in action hook?
- Twenty Eleven Child theme error when attempting to use a rewritten function
- How do I get a child theme to load scripts from the parent theme?
- How to call custom function from functions.php in site-wide template files?
- How to use thumbnails in gallery?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- wp_insert_posts keeps adding multiple pages
- Is there a way to add a class to non current menu item?
- When using wp_enqueue_script(); in a theme why don’t we use add_action?
- how to edit functions.php in a child theme
- Best practice when altering a parent theme function inside a child theme?