That doesn't make sense to me, because this behaviour is not happening within a normal category archive.
For example:
hidden link
The first article in the standard archive loop (Monthly Superannuation Returns Performance Reckoner (for 5 investment options)) is protected.
You can see that here: hidden link
But WordPress shows the elements I want to show through Toolset - the Title and Thumbnail
Is there a way that Toolset can show this view in the same way that WordPress archives show it?
Hello,
Minesh isn't available currently, you will get the answer soon when he is back in tomorrow.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Well - I can tell you simple thing to test. Create a single.php for any specific post type and for that post type try to display restricted post - you will see the login form - that is set to display when unauthorized person try to access restricted post from memberpress plugin.
I tested this and MemberPress is hijacking the normal standard WP_Query. I do not have any way to offer here, as per our support policy, we are not bound to debug the third party plugin code.
The only way I can see you can display the post content is using custom shortcode. So here is the workaround:
Add following code to your current theme's functions.php file:
add_shortcode('display_content', function(){
global $post;
$content = $post->post_content;
return $content;
} );
And in your view's loop output instead of using [wpv-post-body] shortcode - use this custom shortcode:
Hi Minesh - Thanks for your suggestion, but that workaround doesn't work for me.
The result of that code is that it replaces the Title and Thumbnail with the body of the entire post. You can see for yourself here: hidden link
Please note this was the code I had in the Loop Output Editor for that View
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div class="three">[wpv-post-body view_template="Latest News Sidebar - single post"]
</div></wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-posts-found][wpml-string context="wpv-views"]<strong>No posts found</strong>[/wpml-string][/wpv-no-posts-found]
[wpv-layout-end]
Note that it was calling a content template so this is what I following your suggestion
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div class="three">[display_content view_template="Latest News Sidebar - single post"]
</div></wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-posts-found][wpml-string context="wpv-views"]<strong>No posts found</strong>[/wpml-string][/wpv-no-posts-found]
[wpv-layout-end]
Cheers, Rob
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Well - you need to keep your image fields.
You should restructure your loop output with your needed fields - add those fields.
<wpv-loop>
<div class="three">
-- add your image field
-- add your title field ...etc.. etc..
[display_content]
</div></wpv-loop>
After a bit of trial and error, I worked out that I do not need the [display_content]. That was displaying the post content, which is not what I wanted.
For your records this is what I changed it to to make it work (in the View > Loop Output Editor
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<div class="three"><li class="media">
<a class="pull-left thumbnail" href="[wpv-post-url]">[wpv-post-featured-image]</a>
<div class="media-body">
<h3 class="media-heading"><a href="[wpv-post-url]">[wpv-post-title output="sanitize"]</a></h3>
</div>
</div></wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-posts-found][wpml-string context="wpv-views"]<strong>No posts found</strong>[/wpml-string][/wpv-no-posts-found]
[wpv-layout-end]
I also did not need what you suggested to add to functions.
However, this means that if I ever need to change that layout I have to change it on every View (we have over 50) one by one, rather than only once in the Content Template.
Is there a way to do this where I can use a Content Template?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Could you please try following shortcode:
[wpv-post-body view_template="Latest News Sidebar - single post" suppress_filters="true"]
Does this help?
Thanks Minesh - That worked and was all I needed.
Cheers, Rob