Query Posts Creates 404 Error
You are not modifying your query, but nuking it completely. Please see query_posts() documentation in Codex on how to correctly re-run query with changed arguments.
You are not modifying your query, but nuking it completely. Please see query_posts() documentation in Codex on how to correctly re-run query with changed arguments.
And this is the indirect way I am using now. If there is any better answer please do share. while ( have_posts() ) { the_post(); $cat = get_query_var(‘cat’); $categories = wp_get_post_categories(get_the_ID()); if (in_array($cat, $categories)) { … } } // end loop
Categories will use category.php by default as their archive template (site.com/category/category-name). Customize that with the code you’ve used here, rather than using a ‘page template’. If you don’t want it to say category/ in the URL there are plugins or functions.php code you can use to remove it that can be found numerous times in … Read more
That’s because you overrule the query. You have to put the original info into the query_posts like so: <?php global $query_string; query_posts($query_string . ‘posts_per_page=10&paged=’.$paged); ?> For more info look here: http://codex.wordpress.org/Function_Reference/query_posts#Usage_Note
In Taxonomy.php (Create on if have none) in your template folder You should have something similer to this code: (taxonomy are similer to archive.php but used for custom post type) <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <!–=== TO GET THE TAXONOMY TITLE ===–> <h1><?php $term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( … Read more
WordPress doesn’t generate an ‘archive of terms’ automatically. However, you’re current permalink structure is set up so that: www.example.com/my_taxo/my-term points to the ‘my-term’ archive page of the ‘my_taxo’ taxonomy (listing all posts with the ‘my-term’ tag). So what you can do is create a page with slug ‘my_taxo’: www.example.com/my_taxo Assign this page a custom template … Read more
You could use Custom Post Types which will keep users from selecting a custom template. Here are a few links to help you get started: WordPress Codex (register post types) Think Vitamin Custom Post Types Tuturial Plug-ins: Custom Content Types Easy Post Types Custom Post Type UI For More Control you might use Custom Taxonomies … Read more
you can use rewrite parameter in register_post_type ‘rewrite’ => array(‘slug’ => ‘product’,’with_front’ => FALSE) and change the permalink structure to postname.
It’s not necessarily a fix, but you should be able to use the Rewrite Analyzer plugin to help you understand how WP is rewriting your links.
The is_tax() function checks if a custom taxonomy archive page is being displayed. So it will only work in template files such as taxonomy-product_cat.php – unless you create new templates for specific categories in the product_cat taxonomy. For example, if you have a product category called “Toasters” and the slug is “toasters” then the template … Read more