Accept HTML in custom function

Trying to store markup in the database is generally a bad idea– some reasons being: Certain characters need to be escaped to be put in the database Having markup in the database will negatively effect any searches you may need to run on the data, now or in the future. Having markup in the database … Read more

Ordering a specific post type

Update I’ve found the solution, by first filtering with is_main_query(), and then using the is_post_type_archive( ‘tribe_events’ ) conditional statement as was proposed in the first answer. function order_calendar_by_artist( $query ){ if ( is_admin() || !$query->is_main_query() ) { return; } if( is_post_type_archive( ‘tribe_events’ ) ){ $query->set( ‘meta_key’, ‘artist’ ); $query->set( ‘orderby’, ‘meta_value’ ); } } add_filter( … Read more