ACF – Get unique values of array

Is correct to do this way? `<ul id=”filters” class=”clearfix”> <?php $taxonomy = ‘categoria_sistemas_sanitarios’; $terms = get_terms( $taxonomy ); $unique = array(); echo ‘<li><span class=”filter-‘. $title . ‘ active” data-filter=”‘; $li = ‘ ‘; foreach ( $terms as $term) { $li .= ‘.’ . $term->slug.’, ‘; } $li = rtrim($li, ‘, ‘); echo $li; echo ‘”>Todos … Read more

Code inside conditional is_tax() only working when term has posts

Possibly not the most elegant. This is my new code snippet based on the Genesis archive.php add_action( ‘genesis_before_content_sidebar_wrap’, ‘custom_do_archive_headings_headline’, 12, 3 ); function custom_do_archive_headings_headline( $heading = ”, $intro_text=””, $context=”” ) { if (is_tax()) { $archive_title = single_term_title( ”, false ); printf( ‘<div class=”title-banner”><div class=”inner-wrap”><h1 class=”entry-title”>%s</h1></div></div>’, strip_tags( $archive_title ) ); } } Thanks @filipecsweb @Milo

Unable to create a new taxonomy

Use the conditional tag post_type_exists() to check if the post type book exists, if it exists add taxonomy to it otherwise not <?php if( post_type_exists( ‘book’ ){ add_action( ‘init’, ‘create_book_taxonomies’ ); // create two taxonomies, genres and writers for the post type “book” function create_book_taxonomies() { // Add new taxonomy, make it hierarchical (like categories) … Read more

Unregistered taxonomy apears still as emtpy filter list

After I little digging I found the right action in the parent theme. The function looked like that (actually exactly the example I linked above): ////////////////////////////// // Add page category filter // ////////////////////////////// add_action(‘restrict_manage_posts’, ‘uncode_page_filter_post_type_by_taxonomy’); function uncode_page_filter_post_type_by_taxonomy() { global $typenow; $post_type=”page”; // change to your post type $taxonomy = ‘page_category’; // change to your taxonomy … Read more