How to hide the year in archive link

You could use a regexp to remove the year, though it’s a little hacky: $string = wp_get_archives(‘type=monthly&limit=20&echo=0’); $pattern = ‘ ((19|20)\d{2}(</a>))’; echo preg_replace($pattern, ‘\\3’, $string); Answer from this stackoverflow question: https://stackoverflow.com/questions/5759720/have-wp-get-archives-return-a-string-with-no-year-in-it

date.php shows only three posts’ title. how to fix it?

Use the pre_get_posts action to modify number of posts per page on date archives. This would go in your theme’s functions.php file: function wpa_date_posts_per_page( $query ) { if ( !is_admin() && $query->is_date() && $query->is_main_query() ) { $query->set( ‘posts_per_page’, -1 ); } } add_action( ‘pre_get_posts’, ‘wpa_date_posts_per_page’ );

Divide WP_Query posts by date & post type

The post_type isn’t really a meta query – therefore, both of these post_types would at least 1 category added/queried in order to get the filter invoked – using plain SQL is still a last resort. add_filter( ‘posts_groupby’, ‘my_posts_groupby’ ); function my_posts_groupby($groupby) { global $wpdb; $groupby = “{$wpdb->posts}.post_date”; return $groupby; } According to your example (I’d … Read more

How to organise post by category and date

Looking for the solution, I want to give more information about what I have done so far: My Actual configuration – WordPress : 3.8 – PHP : 5.3 – Theme : custom based on _s (underscore) – Hebergeur : local XAMPP My archive template <main id=”main” class=”site-main” role=”main”> <?php // get all the categories from … Read more

Show previous month’s posts

This could be a simple PHP issue of how you are asking to return the first date() date(‘M’, mktime(0, 0, 0, date(‘m’), 0, date(‘Y’))); is returning Dec, and WP_Query needs the month number. First, try changing ‘M’ to ‘m’. date(‘m’, mktime(0, 0, 0, date(‘m’), 0, date(‘Y’))); If that doesn’t work, try using the date_query and … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)