Associate custom post types with normal posts
No you don’t really have to create a category to associate your different post types. You can use this great Post 2 Post plugin by scribu. It does exactly what you are trying to do.
No you don’t really have to create a category to associate your different post types. You can use this great Post 2 Post plugin by scribu. It does exactly what you are trying to do.
If you read http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters in detail it outlines everything you need. Take a look at the following code sample taken from the codex. It should help you 🙂 $args = array( ‘post_type’ => ‘Article’, /* This is where you should put your Post Type */ ‘tax_query’ => array( array( ‘taxonomy’ => ‘people’, ‘field’ => ‘slug’, … Read more
That section looks extremely feature-rich and very custom. The possibility of just installing several plugins and getting something like that is pretty much zero (in my opinion). WordPress does have building blocks for such functionality: posts and custom post types for information; comments for discussion; scheduling functionality and calendar-related plugins; plugins for relationships between information; … Read more
like other times, after posting here i found my own question. Maybe its not the smarter solution but its working for me. Im using the new tax_query as commented in http://www.wpmods.com/query-multiple-taxonomies-in-wp-3-1/ Basically if i get 2 taxonomies with two terms for example $job_type=”full-time+free-lancer”; $job_cat=”designer+programmer”; I do the following: $custom_query=false; $myquery[‘tax_query’] = array( ‘relation’ => ‘AND’); … Read more
Personally I would structure it like a CPT for each Hotels, Attractions, Restaurants. Then a custom taxonomy that ties them together for instance “Places” with children like “Locations”, etc. If the site has a lot of connected data it is a really good idea to sketch out the relationships on paper or using software like … Read more
As far as the codex for wp_insert_term says, it is not possible to insert an array directly. Put all your terms in an array, then foreach over it and inside every turn, call wp_insert_term once per term.
I don’t see your call to the ajaxurl in your code. Are you actually getting an ajax response? Try this javascript: jQuery(document).ready( function($) { $(“a.getviews”).click( function() { var td = $(this).parent(); /* only fetch results once */ $(this).unbind(‘click’).bind(‘click’, function(){return false;}); // replace button with loader $(td).html(‘<span class=”loader”></span>’); $.ajax({ type: ‘POST’, url: ajaxurl, data: { action: … Read more
This sounds like a good idea as it would let you query by location etc. I don’t know what you plan to use the co-ordinates for, but it makes no sense to have them attached to an event (unless that event is a one-off in the middle of a field, but I guess that would … Read more
For something like this you might consider adding an ‘action’; which appear when you hover other the item. The following code is not complete, and hasn’t been tested – but should get you on the right track. Add the action First, to add the action link, use the tag_row_actions hook. (Keep in mind a function … Read more
You can set a filter for the title element’s content – hook ‘wp_title’ – and add any data you want to it. See this answer for an example. On archives use get_queried_object() to detected the taxonomy, on singular views (posts, pages, custom post types) the global $post is available.