Unable to browser posts in categories
This is an issue with your htaccess or mod_rewrite on your server. Try overwriting your .htaccess with this snippet from the WordPress codex. Or see the mod_rewrite section that is also on that page.
This is an issue with your htaccess or mod_rewrite on your server. Try overwriting your .htaccess with this snippet from the WordPress codex. Or see the mod_rewrite section that is also on that page.
it is possible to do on server side but you would have to create an output buffer and the either use Regex or Dom phrase to get all of the links. a much easier solution would be to use JavaScript or even better jQuery.
Let’s start from the top: $current = get_the_category(); This returns an array of objects, one object for each category. $current_id= $current[0] ->cat_ID; This returns an object, the first object in the previous array $categs_list = get_category_parents($current_id); This returns a string, but only if the current category has parents; otherwise, it returns whatever was passed to … Read more
// Category should be ‘cat’ <?php $args = array( ‘cat’ => $cat, ‘orderby’ => ‘post_date’, ‘order’ => ‘DESC’, ‘post_type’ => ‘blog’, ‘post_status’ => ‘publish’ ); ?>
Simply add the ‘category__in’ => $category_id_array argument from your second query inside your first query. If this doesn’t work, make a tax_query, with both kund and post_category taxonomies
If you have a single level of subcategories under your main categories, you can just do this: $category = get_category( $cat ); if( $category->category_parent ): $parent = get_cat_name( $category->category_parent ); echo ‘<h1>’ . $parent . ‘</h1>’; else: echo ‘<h1>’ . $category->cat_name . ‘</h1>’; endif;
A somewhat ghetto but fast way to do this is to just use get_template_part, for example, get_template_part(‘index’); A better use for it is to grab “parts” of your template and not a whole index, but it still works. http://codex.wordpress.org/Function_Reference/get_template_part
Finally solved it! I needed to add this at the end of each loop 🙂 <?php $my_query = new WP_Query(array( ‘category_name’ => get_post_meta($post->ID, ‘featured’, true), ‘posts_per_page’ => 5, )); if ($my_query->have_posts()): ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> content etc goes here <?php endwhile; ?> <?php endif; ?><?php wp_reset_query(); ?> many thanks James
The canonical code within WordPress should actually already redirect those old posts to the new posts automatically. Have you tested that?
You can’t have / as category and tags base, at least not without using a plugin like this one: http://wordpress.org/extend/plugins/fv-top-level-cats/ Doing it for both tags and categories seems almost impossible to me though.