It turns out not all hosts treat sessions alike. I ended up scraping altogether the “session” code in functions.php previously referred to which was doing nothing.
Instead, I added session_start()
at the top of every template adding or retrieving a value from a name/value hash in $_SESSION. So,
<?php
session_start();
$_SESSION['order_id'] = $order_id;
. . .
$order_id = $_SESSION['order_id'];
Related Posts:
- Sending the reset password link programatically
- How to change upload directory in wp_handle_upload
- Only show div on homepage/blog index in wordpress/php
- Calculate percentage of post by category
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- register_rest_route regex option for base64 or alternate
- Select dropdown not showing selected value php
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Customized title tag for each page in pagination?
- Can is_page() be combined with a switch control structure?
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- Run a filter when a walker runs
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- have_posts() execution failure
- WordPress with php 5.5 and zend opcache
- Woocommerce add to cart quantity buttons with AJAX
- Display fields as values in array from external SQL DB
- my posts are saved as drafts
- How can I remove a function that has been added to wordpress with add_filter?
- Create a range slider to change font-size with different screens sizes in wordpress customizer api
- Ajax load more posts with multiple tax query
- Are there security or other issues with changing PHP time limit and max input vars?
- How can I pass a custom/dynamic product to the Woocommerce cart?
- Adding Taxonomy Image to taxonomy loop [closed]
- Irregular TTFB and server wait time response
- How to get private property in parent class into extended class?
- WP_Query fails despite having 1 post
- Loop stopped working
- How does WordPress differentiate what scripts are loaded in wp_head() and wp_footer()?
- Download PDF after CF7 form submission
- 3 different times on my WordPress website
- Flexslider won’t work on WordPress
- Unable to Find Space in Custom Function
- Simple WordPress endpoint route doesn’t work
- Is it possible to create new user from external form using REST API?
- WP_Query: getting posts where custom field exists
- Foreach loop inside an array_merge
- HTML dropdown setting not showing last saved value in the database
- Show the section only if custom taxonomy was chosen
- How to separate categories with commas?
- Cant display an image via PHP in wordpress
- How do I make this Metabox show current DB value?
- Limit posts when visited with mobile devices
- Unable to Call More than One Meta Box Output
- Make a page (url) not cacheable [closed]
- mySQL queries are executed twice on wordpress website
- Populate custom field on publish or update
- Most viewed posts in WordPress
- Is there a (offical) way for a theme to deactivate itself and show a message in admin?
- Trying to load category thumbnails on wordpress page
- Insert PHP code in Text
- Site DOES NOT LOAD after 3.1 update
- Dropdown category field inside repeatable metabox
- How to extend SelectControl with data from my theme
- Retrieve alt text by referencing the img src
- Order users by random not working?
- var_dump() and print_r() display null in php
- Delete post meta by serialized meta value
- How to get a post’s attached media (audio) ID and insert it into rtmedia shortcode
- Create a temporal post
- add custom link to gallery images
- Sessions with WordPress
- How can I copy an ACF field to AIOSEO field? [closed]
- How to find php variable of wordpress theme settings
- WordPress post insertion from PHP file
- how to call other plugins once custom post has been inserted
- Date of last blog update for specific authors only?
- I was wondering if it’s possible to implement card.js on WordPress
- How can I add “.html” to the end of a single URL on a WordPress website?
- Ajax call URL 404’ing when pushed to staging server
- Modify arguments for parent theme’s `wp_register_style` via child theme
- WordPress Rewrite Issue
- Replace content in WordPress Page after GET from php page
- How to Publish WP original Source metabox value on front-end webpage
- How to wrap a text with shortcode into php file?
- error with WP custom form
- WordPress won’t display errors at all
- How to edit the default database of WordPress [closed]
- how to use header function in wp-load.php file [closed]
- changed front-page template gives 500 error
- PHP Syntax getting PHP terms
- Transate plugin with js & wp_localize_script
- WP Custom tables query
- Disable single posts, but keep archive
- Display terms on product page with shotrcode
- How to build a dropdown with tags for same post type?
- WCFM Custom form
- Stop breadcrumb function retrieving custom post type template name
- Slug not being updated using wp_insert_post
- getJSON response to PHP
- Custom plugin with shortcode not working
- Get category name of current post (CPT UI)
- Filtering image class at output
- Count post with tags within one category?
- counting slugs not working?
- How can I run a second wp_remote_post() based on the response of the first?
- Deleting all CPT related to user deleting
- Restricting Image Upload Sizes using ‘wp_handle_upload_prefilter’ – Stuck media progress bar when Featured Image?
- WordPress install on new server not recognising MariaDB version
- Display data with a yes or no condition ACF