Forums › Forums › Search & Filter Pro › RestrictContentPro Integration
Tagged: resrictcontentpro
- This topic has 30 replies, 3 voices, and was last updated 6 years, 10 months ago by Ross.
-
Anonymous(Private) November 14, 2017 at 9:35 pm #141975
Yes I did and no it doesn’t.
RCP replied: The problem is that you’re using a shortcode from a custom plugin. Our code only removes restricted posts from the main WordPress query – not custom queries and shortcodes as well. That would require some custom code. Depending on how that shortcode is set up, you may just be able to copy our code from query-filters.php to a custom plugin and remove this chunk:
if ( ! $query->is_main_query() ) {
return;
}So is it worth persisting with SearchAndFilterPro or should I switch to SearchWP is my issue at the moment. What’s the best way to do it with S&FPro?
Anonymous(Private) November 14, 2017 at 9:40 pm #141977Example use cases:
Client has four membership/subscription levels: free, Politics, Economics, and Plus (plus includes all content).
Content has to be restricted by subscription level, and content posts are also tagged by category so they can be filtered on specific pages for that category.
Ie: a politics page, or an economics pageNot logged in:
On Search Results Page: Sees all content, but there is a “restricted – get access” indicator / button.
Includes feature to filter only content they are allowed to see. Off by default.
On Econ & Policy pages (via search shortcode + category):: Sees only free contentLogged in – Econ / Politics
On Search Results Page: Sees all content, but there is a “restricted – get access” indicator / button.
Includes feature to filter only content they are allowed to see. Off by default.
On Econ and/or Policy pages (via search shortcode + category): Sees only content they have access to, plus free content
Restricted indicator before they click through to the body of the post.Logged in – Plus
On search results page: All content, no filter shown because no filter needed
Econ / Policy pages (via search shortcode + category): All content.Trevor(Private) November 15, 2017 at 11:10 am #142051I think it can be done in our plugin, as we have a filter that you can use:
If you showed the author of RCP that function, they might be able to suggest how to use it with their code.
It might also simply be that their code has to run after ours, as we use the standard query, but we overwrite the theme query.
Anonymous(Private) December 12, 2017 at 1:02 am #146934Hi,
Working through this currently, thanks for the help so far.On https://www.designsandcode.com/documentation/search-filter-pro/search-results/infinite-scroll/
you say at the bottom: “I will be writing a quick tutorial for the Archive (using WP 2016 theme) and Shortcode display methods over the next couple of weeks.”
Is this tutorial available? The currently docs are a bit thin on how the display options work for the different display results settings, especially in the case of a large number of posts that are being scrolled through. I’m also wondering about performance issues with a large number of posts for infinite scrolling and the use case where you direct link to one of those posts with an anchor tag.
Anonymous(Private) December 12, 2017 at 6:13 am #146937Also could explain a little more about how the infinite scroll works?
I gather you’re using WordPress pagination but the WP pagination settings (https://codex.wordpress.org/Pagination) don’t seem to have any effect.Is there any way to configure the number of results to fetch for each “page” of the infinite scroll?
Is there any way to return the total number of results for the whole infinite scroll page? (like a pre-fetch query)Trevor(Private) December 12, 2017 at 2:32 pm #146978Hi
The guide did not get written, I am sorry. Which Display results method are you using? For the Shortcode method, there is an exemplar
results-infinite-scroll.php
file in our plugin’s template folder. The contents of that file need to be used in either the custom results.php file you use or one numbered after the form, in a sub-folder of your child theme folder, as discussed here:The number to fetch each time is set by the General Results Per Page setting in the form.
I think that code should answer your other questions as well.
Anonymous(Private) December 12, 2017 at 10:59 pm #147096Hi,
I’m already using a shortcode and the example template, numbered after the form. I get that.I don’t fully understand “Using the Post / Result Selector Option” and “Using the Infinite Scroll Container Option” and was after a more comprehensive working example illustrating how it works.
>>The guide did not get written, I am sorry.
You should write one to fully flesh out the documentation.
>>The number to fetch each time is set by the General Results Per Page setting in the form.
As in standard WP pagingation setting? I tested that yesterday and it didn’t appear to work, but I’ll test it again today. Is there a minimum amount it will fetch?
Here’s the use case:
http://wordpress-126708-362887.cloudwaysapps.com/all-tips/ is using the infinite scroll template.http://wordpress-126708-362887.cloudwaysapps.com/economy/ links to tips displayed on this page via the widget menu on the right. The infinite scroll page has been adjusted to add anchor tags so you can link directly to a tip post when you click on it from the right hand widget menu.
Initially when you load the all tips page it loads as far as #7 from the top “Jun 5
The geographical cracks in China’s economy” and will link directly ok, but any after that are not loaded so it will just end up at the top of the page.
The “General Results Per Page setting” in WP settings does not seem to effect the amount of initial tips fetched. -
AuthorPosts