This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Polylang and custom posts

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #34228
    nicolab292nicolab292
    Participant

    Hello Ernest,

    So this is me again, about the issue with Polylang filtering unassigned custom posts, even though I chose to disconnect the search from Polylang.

    Probably you have a fix to offer , just like you had one with the free version of the plug-in.

    Thank you
    Nicolas

    #34237
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Nicolas,

    Sure! That code section is similar for both plugins, and the issue was discovered by you, so it is not yet fixed in the Pro version either. The fix is almost identical:
    (make a backup first)
    1. Look for the wp-content/plugins/ajax-search-pro/includes/classes/etc/class-asp_helpers.php file
    2. Replace it’s contents with this
    3. Save

    Hopefully all goes well and this will work.

    #34256
    nicolab292nicolab292
    Participant

    Hello Ernest,

    Yes, it works! Thank you. Now my specific search in my series of custom posts that do not have a language assigned is operational in both the languages that the website has.

    I also built a “general search” in all the website, that covers both the main pages (that have two versions for language and are mangaged by Polylang ) AND my custom posts that aren’t managed by Polylang.

    But, one of the two things happen:

    – if I apply Polylang compatibility, the custom posts are filtered
    – if I don’t apply Polylang compatibility, the results in the main pages are doubled : both languages come up

    I don’t thing there is way around that, is there? Ideally I would like to have the results in the current language for the main pages + the custom posts. But I understand that this comes from the fact that Polylang filters content that is not in the current laguage, even though these posts are excluded from the scope of what it is supposed to deal with.

    Best regards,
    Nicolas

    #34262
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Nicolas,

    Tough question, that might not be possible, I am not sure.

    If you want, you can add temporary back-end and (s)FTP details, and I can try experimenting with the code directly – but I honestly don’t know if there is a way to get both with the query.

    #34286
    nicolab292nicolab292
    Participant

    You cannot access this content.

    #34287
    nicolab292nicolab292
    Participant

    You cannot access this content.

    #34291
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thanks!

    I made a modification, but I don’t know if it works. It basically allows matches, where the polylang language is not assigned. However, if polylang does not assign a language code to the default language posts, then this will not work, and is not possible to resolve unfortunately.

    Can you please check and verify?

    #34333
    nicolab292nicolab292
    Participant

    Hello Ernest,

    Sorry for the delay in answering. I’m not in the lab these days, and I missed the message in the webmail.

    Well, from what I can see, now, even with Polylang compatibilty ON, the General search outputs pages in both languages. Try my name ‘Nicolas Rey’ or ‘Kodak’ and you can see this.

    So it doesn’t work like I would want it to work: only the current language + custom posts.

    Let me know what you think. If it is too complicated, just put it back the way it was, and we’ll just live with what we have I guess…

    Thank you , I’ll try to be more careful with e-mails in the coming days.

    Best regards,
    Nicolas

    #34335
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Thank you for the feedback. I have restored the original. I was afraid this was going to happen – it seems like the main language is not stored as I was hoping. Unfortunately it seems like this is not possible then.

    #34338
    nicolab292nicolab292
    Participant

    Ok; thank you for trying!

    Best regards,
    Nicolas

    #34339
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

    #34340
    nicolab292nicolab292
    Participant

    You cannot access this content.

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Polylang and custom posts’ is closed to new replies.