Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1347873

    I’m trying to add a filter to modify the orderby part of the query used in a custom function. I have tried the post_orderby filter and post_request filters and both seem to either cause a timeout when saving trying save functions.php for our Enfold child theme or cause the link to the page to break. The function on its own without the filter works fine. I have posted this in other forums and it was suggested it could be an issue with the filters and theme being used.

    #1347896

    Hey Design,

    Thank you for the inquiry.

    You may need to use the pre_get_posts action hook in order to adjust the posts query. Please check the following link for more info and code examples.

    // https://developer.wordpress.org/reference/hooks/pre_get_posts/

    Best regards,
    Ismael

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.