HALODIN
Forum Replies Created
-
Forum: Plugins
In reply to: [Ultimate Wordpress Auction Plugin] Images on iPadExcellent news, thanks for the update!
Whilst I have your ear you could really do with a link back to the auction main page from within each listing. It would make it easier to navigate without using the back-button. It isn’t intuitive for the old guys who use my site 🙂
Thanks,
Craig.
Forum: Themes and Templates
In reply to: Media query preventing menu showing in search.phpIt’s OK I’ve sorted it. Adding “$query->is_main_query()” as a condition to the if statement seems to have fixed it.
// PREVENT SEARCH SHOWING BLOCKED PAGE & POST CONTENT add_action( 'pre_get_posts', 'custom_posts' ); function custom_posts( $query ){ if ( $query->is_main_query() && is_search() && ! is_user_logged_in() ){ $meta_query = array( array( 'key' => '_wpmem_block', 'value' => '0', 'compare' => '=', ) ); $query->set( 'meta_query', $meta_query ); } }Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentThank you, now I’ve blocked and then unblocked my pages which updates the new meta column and then updated the meta query, all of my non-blocked posts/pages are showing in the search for non-logged in users… Fantastic thank you!
I fully understand your point of view with giving priority to paying customers, but it wasn’t clear if I’d paid for support I’d receive a faster answer on this issue, it might be in your interest to flag this. If I have any urgent future questions, I’ll make sure I go through this channel.
Thanks again!
Craig.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentI don’t understand, why does it take so long to get help here? I posted my first of the second series of replies around the beginning of January, it’s now 3 weeks on and I still haven’t received a reply…
Please can I have some help????
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentForgot my backticks!
I’ve tried this as well and it doesn’t work either…
// PREVENT SEARCH SHOWING BLOCKED PAGE & POST CONTENT if ( is_search() ){ if ( ! is_user_logged_in() ){ // your not logged in code $meta_query = array( array( 'key' => 'unblock', 'value' => 1, 'compare' => 'EXISTS', ) ); } else { // your logged in search code $meta_query = array( array( 'key' => 'block', 'value' => 1, 'compare' => 'EXISTS', ) ); } }Could I have some more help please?
Thanks,
Craig.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentI’ve tried this as well and it doesn’t work either…
// PREVENT SEARCH SHOWING BLOCKED PAGE & POST CONTENT
if ( is_search() ){
if ( ! is_user_logged_in() ){
// your not logged in code
$meta_query = array(
array(
‘key’ => ‘unblock’,
‘value’ => 1,
‘compare’ => ‘EXISTS’,
)
);
} else {
// your logged in search code
$meta_query = array(
array(
‘key’ => ‘block’,
‘value’ => 1,
‘compare’ => ‘EXISTS’,
)
);
}
}Could I have some more help please?
Thanks,
Craig.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentSo just to reiterate, all I’m trying to achieve is this:
## WHEN LOGGED IN ##
1) The search should show both blocked & unblocked content.## WHEN NOT LOGGED IN ##
1) The search should show unblocked content only.Thanks,
Craig.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentIt’s probably easier to read like this:
// PREVENT SEARCH SHOWING BLOCKED PAGE & POST CONTENT add_action( 'pre_get_posts', 'custom_posts' ); function custom_posts( $query ){ // if it is a search and the user is not logged in if ( is_search() && ! is_user_logged_in() ){ // if posts/pages are blocked $meta_query = array( array( 'key' => 'unblock', 'value' => 1, 'compare' => 'EXISTS', ) );} elseif ( is_search() && is_user_logged_in() ){ // if posts/pages are unblocked $meta_query = array( array( 'key' => 'block', 'value' => 1, 'compare' => 'EXISTS', ) );} $query->set( 'meta_query', $meta_query ); }Either way it doesn’t work. I had a look in MySQL to see if I could work out which columns/values relate to “key”, “value” and “compare”, but I couldn’t relate this meta query to the data. I’m a bit stuck now.
Cheers,
Craig.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentand every other variation on the elseif statement:
{$meta_query = array(array(‘key’ => ‘unblock’, ‘value’ => 0, ‘compare’ => ‘EXISTS’,));}
etc…
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentI tried this (I’m not a developer!) but it didn’t change the behavior of the search. Unblocked pages are still blocked by the search when not logged in.
// PREVENT SEARCH SHOWING BLOCKED PAGE & POST CONTENT
add_action( ‘pre_get_posts’, ‘custom_posts’ );
function custom_posts( $query ){
if ( is_search() && ! is_user_logged_in() )
// if posts/pages are blocked
{$meta_query = array(array(‘key’ => ‘unblock’, ‘value’ => 1, ‘compare’ => ‘EXISTS’,));}elseif ( is_search() && is_user_logged_in() )
// if posts/pages are unblocked
{$meta_query = array(array(‘key’ => ‘block’, ‘value’ => 0, ‘compare’ => ‘NOT EXISTS’,));}$query->set( ‘meta_query’, $meta_query );
}Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentPosts are ALWAYS blocked, pages are sometimes blocked.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentOne point to add, I block posts and pages, so I’m trying to find a solution for both.
Thanks.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentHello,
I may have been a bit too quick to say this has fixed my problem 100%, it has blocked ALL non-blocked content when not logged in. I have a mixture of blocked and unblocked content. What I’m trying to achieve is this:
## WHEN LOGGED IN ##
1) The search should show both blocked & unblocked content.## WHEN NOT LOGGED IN ##
1) The search should show unblocked content only.Is this something you could help me with please? I have tried to amend your code, but without any luck.
Regards,
Craig.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentThanks for the reply. Yes everything is blocked by default. I’ve just added your code to my functions.php and it’s fixed the problem!!!!
Big Christmas thanks from me!!!
Cheers,
Craig.
Forum: Plugins
In reply to: [WP-Members Membership Plugin] WP Search bleeding blocked contentI posted a request for help 2 weeks ago, can someone offer some advice please?