Hello,
In my website hidden link
Login: develop
Pass: June2021
I have Upcoming Tax Sales that shows in 2 columns, first column is "Featured" and it should show all the tax sales that have not content restrictions. The second column is "Member" and it should show all the tax sales that are for members only.
Right because I am using the following code if a user is logged in can see the 2 columns and if it's logged out can only see it as "Featured". I want to show the 2 columns all the time even if user is logged in or not, and then restrict the url only.
Your question makes it sound as if this "works", except when logged out the right column is entirely missing and you want the column to be shown but its content to be hidden.
But from your description, it also sounds like the left column content should always be visible, whether users are logged in or not, while in the right column, perhaps you want to display a log-in link to logged-out users but the restricted content to logged-in users, would that be right?
Also, I'm not sure about your conditional shortcodes that check the custom field um_content_restriction. In the context you have used them, that means checking whether the page where you have added this markup itself has a value for the um_content_restriction custom field.
Is that what you intend?
This seemingly comes from some 3rd-party plugin I'm not familiar with, but I would imagine that you have individual posts that are marked as private or public using that custom field, no?
In which case you would make a View to display the public content (by adding a Query Filter that checks if that custom field is not 1), and a different View to display the private content (by adding a Query Filter to check if that custom field is 1).
Then you would only use the conditional shortcode to check if users were logged in or not, and you would have a structure something like this:
<div class="left-column">
<!-- public content for all users -->
</div>
<div class="right-column">
[wpv-conditional if="( '[wpv-current-user info='logged_in']' ne 'true' )"]
<!-- link to login form -->
[/wpv-conditional]
[wpv-conditional if="( '[wpv-current-user info='logged_in']' eq 'true' )"]
<!-- restricted content for logged-in users -->
[/wpv-conditional]
</div>
That almost works, but I am also showing different kinds of content for each column, that is why I am using the um_content_restriction. I need a way to check for the um_content_restrition of the post in the loop and if it's not user restricted show on the left column and if it's user restricted show on the right. so I will have different posts in each column
I need a way to check for the um_content_restrition of the post in the loop and if it's not user restricted show on the left column and if it's user restricted show on the right. so I will have different posts in each column
I'm assuming here that you want to check each post individually that is listed on the page for the um_content_restriction value. In this case you will need to check the value in the view itself inside the <wpv-loop></wpv-loop>
In this you can essential curate which posts should be displayed in the view loop for logged out users. An alternative is to create a separate view that will just display those posts that are available for the logged out users.
Using Nigel's setup above you can essentially add that view to the section for logged out users.