Forums

get_children() not working after a filter is applied (6 posts)

  1. discountufoparts
    Member
    Posted 7 months ago #

    Does anyone know why get_children would stop working after I apply a filter in the search results. This works correctly in all archives/categories but when the same filter applies to search results it causes the get_children function to fail completely. Any help would be appreciated.

    Thanks.
    David

  2. alchymyth
    The Sweeper
    Posted 7 months ago #

    wht filter? what get_children code?

    please paste the full code of the template into a http://pastebin.com/ and post the link to it here - for how to, see: http://codex.wordpress.org/Forum_Welcome#Posting_Code

  3. discountufoparts
    Member
    Posted 7 months ago #

    I posted the related code in this pastebin file:

    http://pastebin.com/wE8xiKMG

    The template is at the top. The function file is pasted below it. The template works correctly when it is just a search but a search with the filter applied breaks it.

    You can see what is going on at http://www.maineclassifieds.com do a search for boats. The use the filter on the right to limit the search. I have narrowed it the get_children function failing with the array applied to it. Yet it is the same array that is available in the regular search.

  4. discountufoparts
    Member
    Posted 7 months ago #

    I added a print_r of the arrays in question and a var_dump of the object that get_children should be returning. This feature works fine in the category listings but when applied to search it fails after the filter is applied. I do not know if there is something that would be conflicting in a search results loop vs a category listings loop?

    Thanks for any help anyone can give me.

  5. discountufoparts
    Member
    Posted 7 months ago #

    I have gotten to the point now where it is saying my array is empty when its not. I do not have any idea why that could be happening.

  6. discountufoparts
    Member
    Posted 7 months ago #

    Actually was able to resolve this myself. I had to change the get_post inside of the standard get_children to query_post and reset the query at the correct point and make my own get-children function to apply to the situation at hand. Thanks for anybody who looked into this and didn't post.

Reply

You must log in to post.

About this Topic