Plugin interfering with queries of other plugins
-
When we have the plugin enabled it stops the query results from loop grids (elemenentor, and unlimited elements) from finding any results.
-
Hi @adrianlda ,
I’m sorry to hear that you are experiencing issues with the query results due to our plugin. I would be happy to assist you in debugging and resolving your problem.
Could you please share a screenshot with us? Additionally, a test page would be very helpful for us in investigating the cause of the issue.
I tested our shortcode with loop grids displaying our test products and found that the display was working as expected.
See here: https://share.zight.com/JruZRe7o.I believe there may be a plugin or theme conflict affecting your displays. You can investigate and identify the conflicts by enabling troubleshooting mode using the “Health Check & Troubleshooting” plugin.
See here: https://fullworksplugins.com/docs/uncategorized/investigating-conflicts/Providing a little extra information about the elements you’ve added within the loop grids will help us replicate a similar setup and confirm the issue.
I look forward to your response. Thank you!
Hello, the plugin we using for loop grids which you seem to be in conflict with it the unlimited elements plugin.
The site passes all the health checks, what I’m finding difficult to is how you are conflicting with a simple query, but as soon as I disable your plugin everything starts working again.
Is there somewhere I can take this private, as there some things I don;t want to share on a public forum
what does;
qem_add_custom_types
qem_admin_edit_table_orderDo? as these seem to be breaking the query based on categories
I’ve managed to do a work around on our clients website by ‘inverting’ the loop grid query as it seems to be the include by term that your plugin seems to break, not the exclude by term.
The public source code is here https://github.com/alanef/quick-event-manager
This essentially allows events to be filtered by tag or category
https://github.com/alanef/quick-event-manager/blob/master/legacy/qem-filter-functions.phpfunction qem_add_custom_types( $query ) {
if ( ! is_admin() && $query->is_category() || $query->is_tag() && $query->is_main_query() ) {
$query->set( 'post_type', array( 'post', 'event', 'nav_menu_item' ) );
return $query;
}
}This applys only to the event edit / list setting the default sort
https://github.com/alanef/quick-event-manager/blob/master/legacy/qem-action-functions.phpfunction qem_admin_edit_table_order($query) {
global $post_type, $pagenow;
if ( 'edit.php' == $pagenow && 'event' == $post_type ) {
if ( empty( get_query_var( 'order' ) ) && empty( get_query_var( 'orderby' ) ) ) {
$query->set( 'orderby', 'meta_value_num' );
$query->set( 'order', 'desc' );
}
}
}Is there somewhere I can take this private, as there some things I don;t want to share on a public forum
Not really, as a user of the free plugin. We only give private support to our paying customers and I’m sure you would understand that if we were then to give that same support to free users it would be unfair on those that are paying.
I’m not sure what you wouldn’t want to share on a public forum, but if it were access credentials we would not accept them anyway from free users due to liability concerns.Yes I understand only supporting paid users, I think I’ve spotted the problem with qem_add_custom_types , I’ll check this out on my dev server and report back…
Thanks for diving into this
OK I think what is happening is, that if there are existing/other custom post types besides your ‘events’ then qem_add_custom_types is simply removing them because it’s just setting to post,event,nav_menu_item, what I think you need to do is merge in your custom types into the query, with something like; this certainly made a difference with my local dev version.
function qem_add_custom_types( $query ) {
if ( !is_admin() && $query->is_category() || $query->is_tag() && $query->is_main_query() ) {
$new_types = array('post', 'event', 'nav_menu_item');
$post_types = $query->get('post_type');
if(!is_array($post_types) && !empty($post_types)){
$post_types = explode(',', $post_types);
}
if(empty($post_types)){
$post_types[] = 'post';
}
$post_types = array_unique(array_merge($new_types, $post_types));
$query->set('post_type', $post_types);
return $query;
}
}Hello, just checking in to see if you’d had chance to evaluate my suggested fix above, at the moment I’m having to manually reinsert the fix every time I make an update.
- You must be logged in to reply to this topic.