php - Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?

I have a somewhat difficult question.Is it possible to change the get_posts() or wp_query() function to alter the result

I have a somewhat difficult question.

Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?

  • For example, you want to show some posts/pages with a specific meta lower in the list than other pages
  • You want to show the post with post type 'custom' lower in the list than other pages

Is there some hook for this :)?

I have a somewhat difficult question.

Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?

  • For example, you want to show some posts/pages with a specific meta lower in the list than other pages
  • You want to show the post with post type 'custom' lower in the list than other pages

Is there some hook for this :)?

Share Improve this question asked Jun 9, 2020 at 14:17 Daansk44Daansk44 101 0
Add a comment  | 

1 Answer 1

Reset to default 0

do you mean something like this?

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

Here you can alter the query before it is actually run.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742362549a4429669.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信