How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?

The pre_get_posts filter is immediately before the loop begins in
taxonomy-services.php

That is too late. The main query runs long before your template loads. Move your pre_get_posts filter to your theme’s functions.php, or a plugin or MU-Plugin file, and you should see the difference.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)