Viewing 10 replies - 1 through 10 (of 10 total)
  • Maybe your jobs have no keywords set up correctly or the categories are missing?

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi!

    I see a javascript error on the site:

    Uncaught TypeError: $ is not a function
    at (index):356

    
    <script type="text/javascript">
    $(function(){var t="https://upload.wikimedia.org/wikipedia/commons/c/ce/Transparent.gif",e=!0,o=new Image;o.src=t,$("img").live("mouseenter touchstart",function(){var o=$(this);if(!o.hasClass("Overlay")&&(e||o.hasClass("protectMe"))){var i=o.offset(),n=$('<img class="Overlay" src="'+t+'" width="'+o.width()+'" height="'+o.height()+'" />').css({position:"absolute",zIndex:9999999,left:i.left,top:i.top}).appendTo("body").bind("mouseleave",function(){setTimeout(function(){n.remove()},0,$(this))});"ontouchstart"in window&&$(document).one("touchend",function(){setTimeout(function(){n.remove()},0,n)})}})});
    </script>
    

    This is being caused by the WP Content Copy Protection Premium plugin. I highly suggest that you don’t bother with this type of plugin. Firstly, as we see here, they often fail or cause problems on the site. Secondly, I suggest you read this:

    https://wptavern.com/content-protection-plugins-for-wordpress-do-more-harm-than-good

    https://halfelf.org/2015/stop-using-copy-protection/

    Once you turn off that plugin, let me know if the search continues to fail or not.

    Thread Starter ChristinaHooper

    (@christinahooper)

    I had already tried turning off that plugin and that didn’t fix it. I’ve completely uninstalled it and it’s still not working.

    It’s also not working in the admin of the site either – I can’t even search jobs there.

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi!

    I see; it looks like something is overriding the WPJM search and replacing it with the WordPress search function instead, *and* it’s not including the Job Listings Custom Post Type (CPT); the odd thing is, this *only* happens for keyword search and not for the location search! This is the first time I’ve seen this. It’s possible that there might be a conflict with one of your current plugins or your theme.

    Try disabling all of your plugins except WP Job Manager (and add-ons). Then try testing again to see if the issue persists. If that resolves your issue, you can find what was causing it by enabling each plugin one by one while continuing to test.

    If that doesn’t help, you can also try switching to the Twenty Sixteen theme via Appearance > Themes, and test again. If the issue is resolved then you know it’s a problem with the theme, and you’ll need to contact the theme author for further assistance.

    Let me know what you turn up!

    Thread Starter ChristinaHooper

    (@christinahooper)

    Like I said in my original post — I already did allll those things. Not my first rodeo debugging a plugin. I switched to the default theme, deactivated all the other plugins, recloned from the dev site (since it works there)… nothing worked.

    Since you have a deeper understanding of how the search works, I was hoping you could shed some insights into what else could possibly cause it not to work on the live while it clearly works on the dev site.

    Thread Starter ChristinaHooper

    (@christinahooper)

    I had to hide the keyword search since it’s confusing users. You can remove the “display:none;” in inspect element to continue testing.

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi Christina, sorry, I didn’t go back to read your original post, my fault! I really don’t know why this would be happening. I’ll ask a developer to take a look at this thread.

    Plugin Contributor Richard Archambault

    (@richardmtl)

    Hi Christina,

    Can you contact us using our Pre-sales form please? We’d like to ask you some further questions about your setup without the answers being on a public forum. Mention this thread when you do. ??

    https://wpjobmanager.com/contact/

    Thanks!

    Thread Starter ChristinaHooper

    (@christinahooper)

    I sent the message.

    Plugin Contributor Richard Archambault

    (@richardmtl)

    To publicly close the loop (and in case this helps anyone in the future), here is what our developer found:

    I took a look at both your staging and production sites. On your production site, you have this code at the bottom of your active theme’s functions.php. This code does not exist on your staging site.

    
    function SearchFilter($query) {
        if ($query->is_search) {
            $query->set('post_type', 'post');
            $query->set('post_status', 'publish');
        }
        return $query;
    }
    add_filter('pre_get_posts','SearchFilter');
    

    When you enter a keyword on the job form, $query->is_search evaluates to be true. This snippet then restricts the query to just post types of post, not job_listing. Once you remove this code from your theme’s functions.php your search form should work. Once you’ve done this, make a small change on any job listing and your search cache will be cleared.

    Job manager caches search results (from the [jobs] shortcode) for 24 hours in WordPress transients. If you use the same search term in testing, it could have been using the cached results.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Search Not Working Correctly’ is closed to new replies.