Last active
July 8, 2019 18:13
-
-
Save nickdavis/6822613 to your computer and use it in GitHub Desktop.
Cookies with a cached WordPress website (on WP Engine)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Call Ajax | |
add_action( 'wp_ajax_ajax_action', 'esanctuary_sidebar_cookie'); // ajax for logged in users | |
add_action( 'wp_ajax_nopriv_ajax_action', 'esanctuary_sidebar_cookie' ); // ajax for not logged in users |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there no javascript necessary to rerender the sidebar after load? would the page load with the default sidebar and then update to show the custom one based on the cookie call? I'm not entirely sure of the flow in the example here.