0
votes

I am following the Advanced Custom Field plugin to sort the posts by the custom field values in Wordpress: https://www.advancedcustomfields.com/resources/orde-posts-by-custom-fields/

My question is, inside which files(.php) on Theme Editor am I supposed to insert the snippet of codes?

1
Anywhere before the hook executes. You can use a theme folder or a plugin, the choice is yours. You could have a functions.php in your theme folder for example - Scuzzy

1 Answers

1
votes

If its wp_query or get_posts you can insert them straight into the template/post/page file you want them to appear (or you can create a function for them).

If you are using pre_get_posts you need to add it to the functions.php file.