Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
1

This question is a follow up of this question you asked earlier. Here we handled getting count per posttype. So you have all data, just not sorted correctly. Looking at your code you have one big problem. Getting and formatting data is done at the same time as you are outputting the data. For maintainability (and readability) it is best to separate these as ...


1

You can set orderby slug like : $tags = get_tags( 'order=ASC&orderby=slug' ); $html = '<div class="post_tags">'; foreach ( $tags as $tag ) { $tag_link = get_tag_link( $tag->term_id ); $html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>"; $html .= "{$tag->name}</a>"; } $html .= '</...


1

You have all sorts of fun questions today! There is also a WP_Term_Query available in WordPress. Here is some info on it as well as what parameters you can pass it. https://developer.wordpress.org/reference/classes/WP_Term_Query/__construct/ $term_args = array( 'taxonomy' => array('tax_one', 'tax_two', 'tax_six'), 'hide_empty' => false, 'fields' ...


1

When importing you could create a taxonomy for each unique stance key, then add the value as a term to the taxonomy for that key, then assign that term to the post. I'd suggest something like: Store the stance keys somewhere in the database (probably as options), making sure that you don't have duplicates. Depending on how many you have, this could ...


1

You need to update below line at where you have register a custom post type using register_post_type function. 'rewrite' => array('slug' => 'courses/%cat%') To change permalink dynamically of post type you have to add below code in functions.php file : function change_link( $post_link, $id = 0 ) { $post = get_post( $id ); if( $post->post_type ==...


Only top voted, non community-wiki answers of a minimum length are eligible