Custom Taxonomy archive returns 404
From the Admin Dashboard, Go to Permalink Settings and hit Save Changes. Hope this will solve the problem.
From the Admin Dashboard, Go to Permalink Settings and hit Save Changes. Hope this will solve the problem.
While the solutions provided here do still work, WordPress has evolved since and does now (since 3.3, I believe) provide direct hooks for theme activation. after_switch_theme will fire on theme activation and switch_theme before deactivating an old theme. Hence the up-to-date answer is: function reflush_rules() { global $wp_rewrite; $wp_rewrite->flush_rules(); } add_action( ‘after_switch_theme’, ‘reflush_rules’ );
Combine tax_query and meta_query in WP_Query
From your comment, it sounds like you don’t want a metabox. A metabox is used to add metadata to a particular post, not create a new post from scratch. What it sounds like you want to do is create a widget to do what you want and then invoke it through an action or filter … Read more
My old code was wrong, this is a good one, as I think: function add_custom_post_type_to_query( $query ) { if ( $query->is_home() && $query->is_main_query() ) { $query->set( ‘post_type’, array( ‘post’, ‘facebook_events’, ‘event’ ) ); $query->set( ‘meta_query’, array( ‘relation’ => ‘OR’, array( ‘key’ => ‘event_start_date’, //this is from facebook_events post type ‘value’ => date_i18n(“Y-m-d”), ‘compare’ => ‘>=’, … Read more
This is the magic: with timestamps, insteed of ‘type’ => ‘DATE’ must be used ‘type’ => ‘NUMERIC’.
custom taxonomy – Template not working
The short answer is no. For the canonical example of why just take a look at native post types. They are registered twice during each page load: Quite early because of backwards compatibility reasons and plugins possibly expecting them to exist. On init because now locale things are actually loaded and post type definitions can … Read more
It is hard to say with 100% certainty but I think the problem is your use of query_posts. Here is what I believe is happening: The Main query runs with the default parameters and loads your page You clobber the main query with query_posts You generate pagination based on the clobbered main query You click … Read more
if your terms and their slugs are: red, blue, green, yellow. <div data-tag=”<?php echo $terms_portfolio[0]->slug; ?>” would output only the first <div data-tag=”red” if you do <?php $terms_portfolio_slugs = array(); foreach ($terms_portfolio as $tp) { $terms_portfolio_slugs[] = $tp->slug; } $terms_portfolio_csv = implode (‘, ‘,$portfoliotags); ?> <div data-tag=”<?php echo $terms_portfolio_csv?>”> your output would be all of … Read more