Archive of year for some categories using the featured image
Something like this http://wordpress.org/extend/plugins/image-archives/ ?
Something like this http://wordpress.org/extend/plugins/image-archives/ ?
to accomplish that, this what I did for my blog: (1) create a page template, say “masterarcive” (2) add the code in that page. (3) this code also include pagination Here is my entire page template with the complete code I use in it: <?php /** * @package WordPress * @subpackage Default_Theme */ /* Template … Read more
This is probably what you need: <?php if (is_category()) { // Show only on Category archive pages ?> <h1><?php echo single_cat_title(‘News: ‘); ?></h1> <?php } elseif (is_tag()) { // Show only on Tag archive pages ?> <h1><?php echo single_tag_title(‘News: ‘); ?></h1> <?php } ?> OR like this (as @StephenHarris pointed out): <h1><?php if ( is_category() … Read more
the standard WP function for that is: the_date(); (source)
Use just the functions, not the object properties: if ( is_post_type_archive() or is_date() ) There are many conditional functions (returning TRUE or FALSE) for exactly these cases.
I believe this is correct: $year = 2013; $month = 0; $qry = new WP_Query( array( ‘post_type’=>’post’, ‘posts_per_page’=>-1, ‘orderby’=>’date’, ‘order’=>’ASC’, ‘ignore_sticky_posts’ => true, ‘year’ => $year, ) ); while ($month < 12) { $month++; echo date(‘M’,strtotime(‘2000-‘.str_pad($month, 2, ‘0’, STR_PAD_LEFT).’-01 00:00:01′)).'<br>’; if ($qry->have_posts()) { while ($qry->have_posts()) { if (date(‘n’,strtotime($qry->post->post_date)) == $month) { echo ” — “; … Read more
try this… Not Tested add_action(“pre_get_posts”,”my_category_remove”); function my_category_remove($query) { if(is_archive()) { $query->set(‘category__not_in’, array(/*the categories (ID’s) you wish not to show, comma separated*/)); } return $query; } Reference
You should filter the default $query via callback hooked into pre_get_posts: function wpse108983_filter_pre_get_posts( $query ) { // Make sure we’re targeting // the main loop query, and // only in the archive context if ( $query->is_main_query() && is_archive() ) { // Add your query modifications here // For example, to sort by date: $query->set( ‘orderby’, … Read more
do so like this add_filter( ‘getarchives_where’, ‘my_archives_filter_function’, 10, 2 ); create function function my_archives_filter_function($text, $r) { return “WHERE post_type=”post” AND post_status=”publish” AND post_date >= ‘2013-08-01′”; }
function namespace_add_custom_types( $query ) { if( is_category() || is_tag() && empty( $query->query_vars[‘suppress_filters’] ) ) { $query->set( ‘post_type’, array( ‘post’, ‘post_type1’, ‘post_type2’ )); return $query; } } add_filter( ‘pre_get_posts’, ‘namespace_add_custom_types’ ); it worked realy good.