Create dropdown menu of all tags used in category

Try building a master $posttags array like so: <?php $post_tags = array(); $the_query = new WP_Query( ‘posts_per_page=50&cat=89’ ); if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); $posttags = get_the_tags(); foreach( $posttags as $posttag ) { $post_tags[$posttag->slug] = $posttag->name; } endwhile; endif; ?> <ul class=”dropdown filter option-set clearfix” data-filter-group=”tags”> <li><a href=”#filter-tags-all” data-filter-value=”.item” class=”selected”>All …

Read more

Exclude Tags by Array

You could achieve this with get_terms() and ‘name__like’ => ‘Author:’ argument. See linked documentation. From architecture perspective, however, you probably shouldn’t be (ab)using tags for this. It would make sense to split your authors into custom taxonomy. It would be more clear semantically, as well as easier to deal with in interface and code.

Non-array argument in array_merge()-function [closed]

Just make sure it’s definitely an array before you try to merge it: function minevalg_hent_innstillinger() { $defaults = array(); // define this somewhere; reference it here if ( is_array( $options = get_option( ‘minevalg’ ) ) ) $options = array_merge( $defaults, $options ); else $options = $defaults; return $options; }