Dear Sir/Madam,
I have a home page, there is a condition setting to show the button
[wpv-conditional evaluate="false" if="('[wpv-current-user info='id']' eq '')"]
<div class="buttonDIV">
<a href="/tour/[types field='tour-number'][/types]"><button class="50pc">了解詳情</button></a>
<a class="iframe fancybox-iframe" href="/new-application/?tour-code=[types field='tour-number'][/types]"><button class="50p">立即報名</button></a>
</div>
[/wpv-conditional]
[wpv-conditional if="('[wpv-current-user info='id']' eq '')"]
<div class="buttonDIV">
<a href="/tour/[types field='tour-number'][/types]"><button class="50pc">了解詳情</button></a>
<a href="/wp-login.php"><button>登入報名</button></a>
</div>
[/wpv-conditional]
English of 立即報名 is Apply Now
English of 登入報名 is Login and apply
When I login, click the 登入 from the Menu, it redirects me to /my-applications/ page, I click the 首頁 (home page) ,the button shows 登入報名 instead of 立即報名, if I refresh the page, then it correctly shows 立即報名
Is there any wrong setting to my condition?
When I login, click the 登入 from the Menu, it redirects me to /my-applications/ page, I click the 首頁 (home page) ,the button shows 登入報名 instead of 立即報名, if I refresh the page, then it correctly shows 立即報名...Is there any wrong setting to my condition?
Hello, I do not see anything obviously wrong in the conditional code. This code seems okay. Is the conditional code included in a View? If so, you may need to disable caching for the View to force it to update after login. If the View is included with a shortcode, you can disable caching directly in the View shortcode like this:
[wpv-view name="your-view-slug" cached="off"]
If the View is included in the Block Editor instead of using a shortcode, you can disable caching when you select the top-level View block in the Block editor. See the screenshot attached here for a visual guide to disable the Views cache.
Dear Christian Cox,
I find the block is not so user-friendly. How can I add the cached="off"? I change the editor to code editor and add the cached="off", when I change it back to the visual editor, it prompts me This block contains unexpected or invalid content, I click the Attempt Block Recovery and the cached="off" gone.
Please advise the proper way to add the parameter to Views.
Best regards,
Kelvin.
Dear Christian Cox,
I tried to add the cache="off" and redo the steps, no luck. I still got the cached page until I refresh the page and got the correct wording.
Best regards,
Kelvin.
Could I log in and see how this process works? I would like to understand how the login works with redirects.
Please provide login credentials so I can see the problem on the live site.