Warning: Use of undefined constant closed - assumed 'closed' (this will throw an Error in a future version of PHP) in /home/customer/www/codenegar.com/public_html/wp-content/themes/codenegar/functions.php on line 171
ID Status Date Product
#18329859 Closed AJAX AutoSuggest
Siegfried Grimbeek


I have tried activating the “Search posts/produtcs tags:” and it is not working for the regular post type or for custom post types.

It is not displaying any results for the tags and I also installed the lastest version.

I there anything I need to do?

Kind Regards,



Farhad Ahmadi


Enabling the option is enough to get it working.

Just one note: Tag searching is for posts tags and products tags, do you use it for any other kind of tags?

Can you provide a demo URL with some temporary login info?


Siegfried Grimbeek

Hi Farhad,

Thanks for the reply.

I did try the instructions where you change the ajax.php file and this did not work.

Can you send me instructions on additional steps?

I have also tested on posts alone and it still does not work.

Sorry I am working locally and do not have an URL.

But this is an advertised feature of the plugin, should it not just work?

Kind Regards,


Farhad Ahmadi

What did you change in the ajax.php file?

Yes, searching by tag should work, but there is a problem and at first the problem should be found.

Please let me know more info about the situation, e.g. What theme do you use?

Make sure there is no conflict, deactivate all plugins one by one and check if the plugin has started working or not.

Change your theme to another default theme and check again.

I need to know which part is causing the problem to be able to help you.


Siegfried Grimbeek

Hi Thanks,

I totally understand.

I am using a custom built clean theme with not much javascript.

I have activated and deactivated all plugins.

This makes no difference to the plugin, if the “Search posts/produtcs tags:” is checked, no results are found but if it is unchecked, it finds results by the title.

I tried the following:

Yes, searching by tags was added within an update, it was requested by users.
You can enable/disable searching in posts or products tags.
I guess you have several posts with a specific tag and you want to search only within those tagged posts, for this situation you need to do a very little customization.

  • Open ajax.php file which is located in plugin directory.
  • Find line 38 and change it like this: Before changing:
    //'tag' => $tags,

    After changing:

    'tag' => 'my_tag',
  • Save the changes.

For limiting searches to other kinds of taxonomies, categories, custom fields,… the steps are very similar.
I will add a WordPress filter hook for this parameter so it can be modified without having to edit source code.
If you need any help open a ticket. http://www.codenegar.com/support/

Kind Regards,


Farhad Ahmadi

So this is totally obvious.

You edit on source code overrides the plugin options.

When you enable searching by tag option, the plugin uses WordPress action / filter hook to change the search query on the fly.

With your edit on the code, it’s not logical to be able to search both conditions at the same time.


Write a reply

The ticket has been closed. If you feel that your issue has not been solved yet or something new came up in relation to this ticket, you can re-open it by clicking this link.