Custom Post Type Rewrite Throws Headers Sent Errors
This happened to a site a friend of mine was working on. Whats weird is that he deleted the problematic file and copied paste the code into a new php file. It seemed to do the trick. worth a shot?
This happened to a site a friend of mine was working on. Whats weird is that he deleted the problematic file and copied paste the code into a new php file. It seemed to do the trick. worth a shot?
This is enabled by default if your using wp_nav_menu ( the drag & drop menu’s in admin) and have also set show_in_nav_menus to true for your register_taxonomy. To enable them to show go to Admin–>Appearance–>Menus Click “Screen Options” in the top right and you should see it listed there. ps. The post you linked is … Read more
I wouldn’t call myself an expert so test what I’m offering, but you may try to add a hook when you publish the post that uses a preg_match (or similar function) to find those terms in the post content. Then, based on what you found you could add the wp_set_post_terms.
The second parameter of register_taxonomy can accept a string or an array of post types, so simply add the page post type to that array, like so: function qc22_build_taxonomies() { register_taxonomy( “fullscreen-tags”, array( “fullscreen”, “page” ), array( “hierarchical” => true, “label” => __( “Fullscreen Tags” ), “singular_label” => __( “Skill Type” ), “rewrite” => array(‘slug’ … Read more
In your loop you only call the title using the_title if you want to display the terms of the custom taxonomies you need to call them and the easiest way would be to use get_the_term_list for each taxonomy : while ( $my_query->have_posts() ) : $my_query->the_post(); echo ‘<li>’; the_title(); echo get_the_term_list( $post->ID, ‘location’, ‘Location: ‘, ‘ … Read more
Create your custom taxonomies for your custom post type and for each, set the slug to include the findby portion, as in the example below for charity. ‘has_archive’ => true, ‘rewrite’ => array( ‘slug’ => ‘findby/charity’, ‘with_front’ => false ), ‘query_var’ => true, ‘public’ => true, Create your custom post type with desired slug. ‘has_archive’ … Read more
In order to avoid an error like this you’ll have to check whether or not the value of $glossary_letter is an array or not. Since get_the_terms() returns false on failure, you can just check whether or not $glossary_letter is false and set it to an empty array in order to appease array_pop() without getting that … Read more
What I want to do is create a “category page” for each category That would be category archive, not page. See category templates. As all of my “product detail pages” are pages, and not posts, I’m not sure how to set up my taxonomies. It would make sense to create custom post type for your … Read more
Try using this function to avoid your problem: function sld_unregister_taxonomy_from_object_type($taxonomy, $object_type) { global $wp_taxonomies; if ( !isset($wp_taxonomies[$taxonomy]) || !get_post_type_object($object_type) ) return false; foreach (array_keys($wp_taxonomies[$taxonomy]->object_type) as $array_key) { if ($wp_taxonomies[$taxonomy]->object_type[$array_key] == $array_key) { unset ($wp_taxonomies[$taxonomy]->object_type[$array_key]); return true; } } return false; } e.x.: function mwm_unregister_taxonomy(){ sld_unregister_taxonomy_from_object_type( ‘post_tag’, ‘post’ ); } add_action( ‘init’, ‘mwm_unregister_taxonomy’);
Just check the total number of posts found: if($your_query->found_posts > 20) … and decide how do you want your mark-up to be. If want to see how many products are associated with a certain product_category term, use get_term() and check out the ‘count’ property