Archive links don’t work when clicked

OK. Here is your problem. wp_get_archives( $args ); … $args = array( ‘type’ => ‘monthly’, ‘limit’ => , ‘format’ => ‘html’, ‘before’ => , ‘after’ => , ‘show_post_count’ => false, ‘echo’ => 1 ); You are use wp_get_archives incorrectly. That function accepts particular ‘keys’, and cat isn’t one of them. You can use an array … Read more

Displaying Archives List

There is but the filter sucks, it only gives you the link HTML: add_filter( ‘get_archives_link’, ‘wpse74891_archives_link’ ); function wpse74891_archives_link( $link ) { $link = preg_replace_callback( ‘/>([A-Za-z]+\s+\d{4})/’, function( $matches ) { return ‘>’ . date( ‘m.y’, strtotime( $matches[1] ) ); }, $link ); return $link; } Using this method you can pass in any date format … Read more

Modify text after post count

The _n() function will sort out single from plural. How to use it is in the codex. EDIT: Apologies. My first go at an answer wasn’t quite enough to get you there. The trouble with using wp_list_categories() in this context is that it prints out pre-formatted HTML and you don’t end up with any value … Read more

When i try to open archive pages i get a 404 error

Probably you have to go to Permalinks > click “Save Permalinks” and refresh that archive page to see if it solved. If not, then maybe you are using some plugin that caused the problem? deactivate all plugins and re-save permalinks and check that archive page again.

How we display Archives for specific categories

Add this to your functions.php file and replace ‘Uncategorized with the category name add_filter( ‘getarchives_where’, ‘wse95776_archives_by_cat’, 10, 2 ); /** * Filter the posts by category slug * @param $where * @param $r * * @return string */ function wse95776_archives_by_cat( $where, $r ){ return “WHERE wp_posts.post_type=”post” AND wp_posts.post_status=”publish” AND wp_terms.slug = ‘Uncategorized’ AND wp_term_taxonomy.taxonomy = … Read more

What’s wrong with my date_query?

‘date_query’ argument takes an additional option that is ‘relation’ that can be AND or OR. If we consider the relation OR your code, that use exactly same date for ‘before’ and ‘after’ with ‘inclusive’ set to true, should return all your posts: posts before a date + posts after that date + posts in that … Read more

Displaying year, month and day archives differently

Conditional tags FTW. is_month() : Currently viewing a monthly archive is_day() : Currently viewing a single day archive is_year() : Currently viewing a yearly archive is_time() : Currently viewing a time-based archive (hourly, minute, or even seconds) So to test for each of these conditions, add something like this to your archive.php (or whatever template … Read more

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