Tag Info

New answers tagged

0

I'm not familiar with woocommerce, but in general, taxonomies are registered via the init hook with a priority of 1 or default priority which is 10 Your code is fine, so I suspect that your priority is wrong here. In short, you are trying to add the taxonomy to the post type before the taxonomy even exists. Try adding a priority of 11 or higher. This would ...


0

This could be easily accomplished using the plugin Advanced Custom Fields which allows you to easily create relationships between custom post types. However if you don't want to use the plugin, you can also create the metaboxes yourself. Create a custom post type for Productions Create any necessary custom fields for Productions Create a custom pos type ...


0

First thoughts - a custom tax for actors might work. The Taxonomy Images plugin will make adding the headshot easy. I'd maybe make the production a post - or an instance of a CPT - I wouldn't mess around with CSVs at all. You'd build the table in the post. I would perhaps create a shortcode that you could add into this table, which would generate a link ...


1

Does this work? global $post; // make sure the post object is available $slug = $post->post_name; // get the slug // insert the slug into your query $args = array( 'post_type' => 'client_prop', 'posts_per_page' => 10, 'tax_query' => array( array( 'taxonomy' => 'prop_neighborhood', 'field' => 'slug', 'terms' => ...


1

Try adding this in your functions.php file: // Let's stop WordPress re-ordering my categories/taxonomies when I select them function stop_reordering_my_categories($args) { $args['checked_ontop'] = false; return $args; } // Let's initiate it by hooking into the Terms Checklist arguments with our function above ...


0

The way you create a template for a specific term is by a file, called taxonomy-$taxonomyname-$slug_of_the_term.php In your case it would look like this: taxonomy-schools-highschool.php Use this image as a guide for any other specific case that you might have: http://codex.wordpress.org/images/9/96/wp-template-hierarchy.jpg


1

You can use categories with pages by registering the category taxonomy for the page object type: function categories_for_pages(){ register_taxonomy_for_object_type( 'category', 'page' ); } add_action( 'init', 'categories_for_pages' ); If you want to use a separate taxonomy for this, you can register your own taxonomy for pages.


0

For the record I found an answer to this question in the end - I needed to use a meta query rather than a taxonomy query. The correct code ended up being this: $relatedBlogPostArgs = array( 'post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => 1, 'order' => 'DESC', 'orderby' => 'date', 'meta_query' ...


0

you need to use this code to get all the terms : <?php $custom_terms= get_terms('locations'); foreach($custom_terms as $term): ?> <a href="<?php echo get_term_link( $term->name, 'locations' ); ?>" class="browse_more"><?phpecho $term->name; ?> </a> <?php endforeach; ...


1

I wouldn't call it a bug, you haven't done anything to place that restriction on the query for your post. It also seems like a fairly unlikely case where random strings will end up in place of your taxonomy terms for this to even present itself. Anyway, the answer is to modify the query via pre_get_posts to add in whatever taxonomy data you need. I don't ...


1

Well, I’d like to expose my experience in sorting custom post types by category/taxonomy. THE WEB A travel agency web site running on WordPress Main content on custom post type called ‘ruta’ Taxonomy with this structure Type-of-travel > continent >country THE CASE In archive category list pages, the client wanted the posts to be sorted by The ...


0

In your register_post_type, you set 'with_front'=> false, Later you declare the following function without arguments: add_permastruct( 'review', 'reviews/%year%/%review%'); add_permastruct has an argument of with_front and the default value is true, which conflicts with your earlier declaration.



Top 50 recent answers are included