Looking for Direction regarding Custom Posts

The main issue with the rewrites is clashes, not maintainability, since that code would have worked in 3.1 and 3.4 and is unlikely to break, and if it did there’d be deprecated notices for a few versions. I would suggest using renamed posts, but instead use code like this: function change_post_menu_label() { global $menu; global … Read more

Searching Custom Fields

Updated this answer in response to first comment below: if(!empty($_GET[‘city’]) AND !empty($_GET[‘state’])) { // if both fields are filled out, find houses that match both $relation = “AND”; } elseif(empty($_GET[‘city’]) OR empty($_GET[‘state’])) { // if either of the fields are empty, find houses that match either field $relation = “OR”; } $args = array( ‘post_type’ … Read more

Change the Custom Taxonomy URL Slug pattern

After reading through about 20+ post on here, this is what I have come up with… In this example http://test.com/{custom-post-type}/tag/{custom_taxonomy_name}/ or http://test.com/book/tag/css/ Would do the trick I am after. //http://test.com/book/tag/css/ function custom_taxonomies_rewrite(){ add_rewrite_rule(‘^book/tag/([^/]*)/?’,’index.php?book_tag=$matches[1]’,’top’); } add_action(‘init’,’custom_taxonomies_rewrite’); I am not sure on the best way to call this though, right now it is called with init action. … Read more