Creating a page for custom taxonomy archive
That`s the suggestion: make a “news” page with a custom page template for it. Inside there, just query your db as you need. For the moment, i can`t find another solution.
That`s the suggestion: make a “news” page with a custom page template for it. Inside there, just query your db as you need. For the moment, i can`t find another solution.
WordPress only supports revisions for post content, not terms. To create a system that monitors changes in post-term relationships over time, you would have to write a plugin that explicitly handles that. If you’re interested in going down that route, you would probably need to use the save_post hook to save term data (saving as … Read more
This is the following new updated article_type function to make it work: I have removed selected attribute from none option and added selected attribute to that terms having news slug. // This function gets called in edit-form-advanced.php function article_type($post) { echo ‘<input type=”hidden” name=”taxonomy_noncename” id=”taxonomy_noncename” value=”‘ . wp_create_nonce( ‘taxonomy_type’ ) . ‘” />’; // Get … Read more
I think it’s worth clarifying a bit of terminology first: Taxonomy – a set of related terms Term – an entry (I want to just say “term”) in a taxonomy Categories – a taxonomy that’s in the default WordPress Tags – a taxonomy that’s in the default WordPress Category – a term in the Categories … Read more
Not sure if is this, but you can add taxonomies in query: new WP_Query(array(‘posts_per_page’ => $num, ‘post_status’ => ‘publish’,’taxonomy’ => $taxonomy)); You can filter by term with $taxonomy => $term: $taxonomy = ‘seasons’; $term = ‘spring’ /* $terms = array(‘summer’,’winter’) an array */ new WP_Query(array(‘posts_per_page’ => $num, ‘post_status’ => ‘publish’,$taxonomy => $term)); More on WP_Query … Read more
I managed to fix this $labels undefined by writing the following work around. Its custom to how I wanted it to work but it may give others a pointer of how to get it to work for them. It occurs when WordPress could use two types to serve its page and gets confused. Say if … Read more
If you mean to add the description of the term as a title attribute which will show on hover then you can “fork” get_the_term_list function to a version that would add the title attribute, something like this should work: function get_terms_with_desc( $id = 0 , $taxonomy = ‘post_tag’, $before=””, $sep = ”, $after=”” ){ $terms … Read more
You should not use a direct SQL query, instead try the WP_Query tax queries e.g.: $args = array( ‘post_type’ => ‘post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘id’, ‘terms’ => array( 22 ) ), array( ‘taxonomy’ => ‘job’, ‘field’ => ‘name’, ‘terms’ => $terms, ‘operator’ => ‘IN’ ) ) … Read more
I have found that you need to set up the same Custom Taxonomies in your new blog. If your old one was registered as “my_custom_taxonomy”, create the same in your new blog. Don’t create any entries, then try your import again.
I was able to solve my problem with this query, although I bet it can be more efficient (I just couldn’t figure out how to do it.) SELECT DISTINCT p.* FROM wp_posts p LEFT JOIN wp_usermeta um ON p.post_author = um.user_id LEFT JOIN wp_postmeta pm ON p.ID = pm.post_id INNER JOIN ( SELECT txrm.object_id FROM … Read more