ACF Custom field not showing in Timber Taxonomy page

In your PHP file… $context[‘topicTax’] = Timber::get_terms(‘topic’); Timber::render(‘my-template.twig’, $context); … is the correct structure. The problem is that WP’s get_terms returns “dumb” objects that don’t have methods for retrieving ACF info. If you still run into issues, verify that those objects are Timber\Terms rather than WP_Term Also, if you’re looking for the more active forum: … Read more

Query string order by custom field

The query_posts is only useful when you actually know what you are doing. Base on the info you provide this should work for you : $the_query = new WP_Query(array( ‘post_type’ => ‘your_cpt’, ‘posts_per_page’ => -1,//get them all ‘meta_key’ => ‘field_4’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘DESC’ )); ?> <?php if( $the_query->have_posts() ): ?> <ul> <?php … Read more

Get a Taxonomy values in an array

You can retrieve a taxonomies terms with get_terms(). Via their docs: $terms = get_terms( array( ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => false, )); And it returns: (array|int|WP_Error) List of WP_Term instances and their children. Will return WP_Error, if any of $taxonomies do not exist. Which you can view by doing somthing like echo “<pre>”.print_r($terms,true).”</pre>”;