list of tags overlay

Notice that the strip_tags() will remove all HTML tags. If you want to allow <br>, then you can add it as the second input parameter: echo strip_tags( $text, ‘<br>’ ); I want to display them like a list For that case, you could try this example: <p class=”nom”> <ul> <?php the_terms( get_the_ID(), ‘project_tag’, ‘<li>’, ‘</li><li>’, … Read more

add links to list of post terms

Then try to add foreach ( $arr_terms as $terms_links ) { if(!empty($terms_links)) { echo ‘<a href=”#”>’ . $terms_links . ‘</a>’;  } } That checks if the $terms_links is empty, and if so it wont print it out.

get_terms not working when child_of is used

I got it solved on my own so, wanted to answer my own question. in options table the results are cached, so I queried it and delete that. SELECT * FROM `wp_options` WHERE `option_name` like ‘%department%’ department is my taxonomy name here. You can check the function _get_term_hierarchy in taxonomy.php in wp-includes folder.

Get count for all terms inside a parent term

I don’t know why that code didn’t work for you. I copy that code and it work exactly as I expected. You should double check your case, did you unset $args variable before, or you can use another name ($agrs2 for example). Another problem in you question is: if pad_counts doesn’t work, you will get … Read more

Get terms parent ID for conditional IF statement

While this is not specifically WordPress but some general PHP, here’s a solution which you could use: $terms = get_the_terms( $post->ID , ‘prodcats’ ); foreach( $terms as $term ) { $classes=”categoryblock”; switch( $term->parent ) { case 3: $classes .= ‘ blue’ // Notice the space between the opening string – important for CSS break; } … Read more

Wrap custom terms loop

Here is solution, split in arrays: <?php foreach (array_chunk(get_terms( ‘razotajs’, ‘orderby=count&order=DESC&hide_empty=0&parent=0’ ), 6, true) as $array) { echo ‘<div class=”logo_sets”>’; foreach($array as $cat) { ?> <a href=”https://wordpress.stackexchange.com/questions/224950/<?php echo get_term_link($cat->slug,”razotajs’); ?>” title=”<?php echo $cat->name; ?>”><img src=”<?php echo z_taxonomy_image_url($cat->term_id); ?>” alt=”<?php echo $cat->name; ?>” /></a> <?php } echo ‘</div>’; } ?>

Unable to retrieve any child terms using get_terms

Try relying on the new WP_Term_Query() class, here’s an example per your code: // WP_Term_Query arguments $args = array( ‘taxonomy’ => ‘carabana_Cat’, ‘hide_empty’ => false, ‘orderby’ => ‘description’, ‘child_of’ => 28) ); // The Term Query $term_query = new WP_Term_Query( $args );

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