Hello,
Recently, I made a small change on Woody snippet code to display text. But somehow, my website always read the old codes. Then I decided to put debug code (die('come to here')
on each line of code to see which line goes wrong. The strange thing happens, the website seems still looking old code, new code seems not taking effect. I already to clear up the browser cache up to 30 days. But not lucky.
The snippet code looks like the following ([wbcr_php_snippet id="8027"])
-----------------------------------------------
global $current_user;
if ( is_user_logged_in() ) {
wp_get_current_user();
echo '<span style="font-size: 24pt;"><strong>Hello, ' . $current_user->display_name . '! Would you like to see which products are available to purchase?</strong></span>'. "\n"; }
else { echo '<span style="font-size: 18pt;"><strong>Hello, Guest! Would you like to <a href="https://mydomain/my-account/">log yourself in or create an account</a>? We offer a great variety of specially selected products at affordable prices!</strong></span>'; }
-------------------------------------------------
On my home page, I had page likes this:
------------------------------------------
Welcome to <br>My Online Store!
[wbcr_php_snippet id="8027" title="Show different content if a user has signed in"]
<br><br>
<a class="button" href="https://mydomain/shop/">Shop now</a>
--------------------------
It works well before until I find out it is not working when I made a change. Even strange, I put snippet code inactive or removed snippet code on my home page, the website still read an old code and displays text.
I don't know what is wrong with my snippet code? Does anyone encounter the same problem and how to solve it?
Thanks.
Bruce
Recently, I made a small change on Woody snippet code to display text. But somehow, my website always read the old codes. Then I decided to put debug code (die('come to here')
The snippet code looks like the following ([wbcr_php_snippet id="8027"])
-----------------------------------------------
global $current_user;
if ( is_user_logged_in() ) {
wp_get_current_user();
echo '<span style="font-size: 24pt;"><strong>Hello, ' . $current_user->display_name . '! Would you like to see which products are available to purchase?</strong></span>'. "\n"; }
else { echo '<span style="font-size: 18pt;"><strong>Hello, Guest! Would you like to <a href="https://mydomain/my-account/">log yourself in or create an account</a>? We offer a great variety of specially selected products at affordable prices!</strong></span>'; }
-------------------------------------------------
On my home page, I had page likes this:
------------------------------------------
Welcome to <br>My Online Store!
[wbcr_php_snippet id="8027" title="Show different content if a user has signed in"]
<br><br>
<a class="button" href="https://mydomain/shop/">Shop now</a>
--------------------------
It works well before until I find out it is not working when I made a change. Even strange, I put snippet code inactive or removed snippet code on my home page, the website still read an old code and displays text.
I don't know what is wrong with my snippet code? Does anyone encounter the same problem and how to solve it?
Thanks.
Bruce