Get category archives & category’s custom fields

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Get category archives & category’s custom fields

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 8 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7289
    enoversum
    enoversum
    Participant

    Hi Ernest,

    haven’t spoken for quite a bit, hoping you made your way to 2016 in an elegant manner, hehe :). All the best for you then!

    We spoke about category archive pages a while ago, and as far as I remember you said it would be possible. However, even though a post named e.g. ‘Something’ exists, ASP does not return the category page as a result.

    Furthermore, and a bit more interestingly, one can choose custom fields to be included in the search. I have a WYSIWYG custom field (ACF-based) for categories. Unfortunately this is not being shown in the settings of your plugin, possibly because you are only queueing for fields associated with posts or pages? Would it be possible to have those custom fields included in the search?

    All the best

    Eno

    #7302
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Eno,

    It’s nice to hear from you! I wish you a happy new year too 🙂

    Category archives – My apologies, but I don’t recall the exact conversation. I’m guessing by category archive pages you mean the ones when you click on a category (for example under a post), then it takes you to a page listing all the posts belonging to that category.
    In this case it’s basically searching for categories and returning them as results, which you can define on the General Options -> Sources 2 panel.

    Category custom Fields – Yes, exactly that. Taxonomy term metadata is a relatively new feature in wordpress (since 4.4) so it’s not yet implemented in Ajax Search Pro, but it’s a work in progress.
    I’m going to add an extra field to the General Options -> Sources 2 panel to select term metadata – so it will be possible to search for Categories/Terms based on their metadata.
    However I’m not sure if I’m going to take it a step further to “search posts based on their categories metadata” – as this sounds arbitrary to me, since category meta is not directly an addition to posts, but the actual category (or term). Although I’m not sure about this yet.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #7328
    enoversum
    enoversum
    Participant

    Hi Ernest,

    thanks for getting back to me. Too bad you’re too far away for a spontaneous coffee together :).

    Yes, category archives. It’s a list of posts from the category, with more or less info depending on the theme, of course. However, I had this already enabled, but even though I have a post with that search term in a category, it doesn’t output the category page as a result. Is that supposed to happen?

    Category custom fields. Well, yes, that is new, but with Advanced Custom Fields you could store them already since quite a while. This way I am able to give a WYSIWYG field that contains more options for the site’s backend users. If you find time to evaluate it, that would be great. My customers misuse the field to store a lot of information and would like to have it included in your plugin’s search results ;).

    All the best

    Eno

    #7372
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Eno,

    I read your reply earlier, but I had to postpone my answer as I was releasing the new version of ajax search pro. So far it looks promising, will see.

    Yep, that is supposed to happen. It does not search the actual page content but the category itself as the object. I honestly do not recall if we talked about this, but it actually would make sense to somehow connect the categories to the posts. I guess I could make an option, something like “Search within posts belonging to each category”. I’m only concerned of the performance impact – it might be really bad for databases with lots of posts and categories. The search would be performed on a dataset of (post1 x number of categories + post2 x number of categories + ….), which I would say is about 5-10 times the posts table on average.
    The implementation though should not be hard, I think I will add this to the features list to the upcoming 4.7.1, and then we will see how it works.

    I believe they implemented it because of ACF, it was a brilliant idea, much needed. Coming soon for sure 🙂

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.