Tag Info

Hot answers tagged

2

The main query is generated before the template is loaded, the results of the main query are how WordPress knows what template to load. If you want to alter query parameters of the main query to change things like orderby, you should add a function hooked to pre_get_posts. The argument passed to the function contains the query parameters of each query, so ...


2

You need to call global $post before using $post->ID, or better, use get_the_ID() instead.


1

Grab all the post tags and loop over them. If it's deemed an "author" by a pattern match, check to see if the equivalent author_tax term exists. If not, create it. Now you can build two stacks: one for author_tax terms to append to the post, and another for post_tag's to be removed. $post_tags = get_the_terms( $post_id, 'post_tag' ); $authors = $remove = ...



Only top voted, non community-wiki answers of a minimum length are eligible