conditional statement for custom taxonomy

I’m pretty sure you shouldn’t use negation in your conditions… If you check ! is_tax… it will be true not only for other taxonomy pages, but also for singular pages, and any other… So it should look like this: <?php if ( is_tax(‘taxonomy-name’,’taxonomy-one’ ) ) {?> <div class=”test” style=”color: red”><?php the_field(‘field_name’); ?></div> <?php } elseif … Read more

Custom Taxonomy Archive not displaying entries

I think you may need to filter the query for that taxonomy so it displays your movie custom post type. Try adding this to your theme’s functions.php file: function custom_post_archive($query) { if (!is_admin() && is_tax(‘genre’) && $query->is_tax) $query->set( ‘post_type’, array(‘movie’, ‘nav_menu_item’, ‘post’) ); remove_action( ‘pre_get_posts’, ‘custom_post_archive’ ); } add_action(‘pre_get_posts’, ‘custom_post_archive’); You’ll need to add to … Read more

WP Query for variable taxonomies

tax_query requires an array of arrays, and $the_taxes is an array of arrays, you’ve already got 99% of your answer. foreach ($taxes as $tax) { $the_taxes[] = array ( ‘taxonomy’ => $tax, ‘field’ => ‘term_id’, ‘terms’ => $terms, ); } $the_taxes[‘relation’] = ‘OR’; $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => $the_taxes, );

Is it possible to dynamically get queried term AND taxonomy?

In a taxonomy template, the queried object is an instance of WP_Term, one of whose fields will be the taxonomy the term comes from. So, you can start your taxonomy.php as follows: $queried_object = get_queried_object () ; $args = array ( ‘post_type’ => ‘inventory’, ‘tax_query’ => array ( array ( ‘taxonomy’ => $queried_object->taxonomy, ‘field’ => … Read more

disable column on post and user list

You can use the manage_{$screen->id}_columns hooks for this. To manage user columns we can use manage_users_columns which is passed an array of columns and whatever we don’t want we can unset(). /** * Manage User Admin Display Table Columns * * @param Array $columns * [cb] => <input type=”checkbox” /> * [username] => Username * … Read more

How do I get the current tag out of a taxonomy?

What you are looking for is get_the_terms(). You can get custom terms for the current post by using the following code: $post_tags = get_the_terms(get_the_ID(), ‘portfolio_tags_client’); if ($post_tags) { ?> <div class=”tags-div”> <h3><?php _e( ‘Tags’, ‘text-domain’ ); ?></h3> <div class=”post-tags”><?php foreach($post_tags as $tag) { echo ‘<a href=”‘.get_tag_link($tag->term_id).'” title=”‘.$tag->name.'”>’. $tag->name .'</a>’; } ?> </div> </div><?php } This … Read more

Retrieve taxonomies from arbitrary site

how can I retrieve all taxonomy terms for a post in an arbitrary site programmatically? In other words, given post $post and site $siteId, how can I retrieve all terms for all taxonomies of that post in that site? You can do this by omitting the taxonomy from WP_Term_Query: $query = new WP_Term_Query( [ ‘object_ids’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)