New answers tagged

2

To do that, you'll need a custom query - Wordpress doesn't have a ready-made function for getting that type of data from the termmeta table. The custom query uses get_col() which allows you to get an array of the term_ids where the meta_key and the meta_value match the values you have in the question. Notice that the query uses prepare() which is good ...


0

WordPress tracks which object types taxonomy applies to. This can be established on taxonomy registration or at some point after, so you shouldn't be trying to do this too early. The approach would be to retrieve the list of taxonomies for the native post type and use it with lower level function, which supports multiple taxonomies: $terms = ...


2

On the top of my head there are two easy ways to go about this problem, first is to use the get_the_tags() function to manually loop the tags to easily insert the hashtags. $tags = get_the_tags(); if ( $tags ) { foreach ( $tags as $tag ) { ?> <a href="<?php echo get_tag_link( $tag->id ); ?>"> <?php echo '#' ...


0

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="<?php ...


0

I found an answer that works well. Using two dropdowns in a 'cascading' style, with the code in the gist below, users would pick from a list of parent terms first, then a second dropdown appears with the list of children. The key is that both the parent and the child terms are 'selected'. Just took a bit of tweaking to get it right, but it seems to work ...


0

For the archive by the term, you should go with taxonomy template. For you it will be taxonomy-project.php When you work with custom post type , you should update the permalink structure when you make changes on templates, I mean register new post type or create new template file


1

I think since the users are a CPT, it would be well suited to do this in post_meta on the user. You could store the temporarily unsubscribed term there and check against when sending notifications. For example, your post_meta could be an array such as this: subscribed_list_term => "maybe_cool_for_summer_list_term", subscription_duration => ...


0

What is wrong here is your assumptions that the values should be the same. I don't know of the top of my head what exactly the term count represent, and it is not apparent from the docs, but it is most likely a raw number of posts associated with the term. OTOH wp_query (which is used for the main loop) takes into account user permissions on top of that raw ...



Top 50 recent answers are included