How do I visit archive-post.php?

You don’t, archive-post.php doesn’t exist, it’s just archive.php, and on most sites the post archive is the root of the site, aka /. Depending on how you’re viewing posts it’ll use home.php, front-page.php, index.php, etc. You should refer to the template hierarchy diagram, but remember, the standard post post type is a special case, as … Read more

Archive widget – limit number of months to 12

Use the widget_archives_args filter to add the archives limit. function my_limit_archives( $args ) { $args[‘limit’] = 12; return $args; } add_filter( ‘widget_archives_args’, ‘my_limit_archives’ ); And to limit the number of months in Archives widget dropdown use the following drop down filter. add_filter( ‘widget_archives_dropdown_args’, ‘my_limit_archives’ );

Archive by Year

The Simple Yearly Archive Plugin does just that. This code will also do the trick: <?php // get years that have posts $years = $wpdb->get_results( “SELECT YEAR(post_date) AS year FROM wp_posts WHERE post_type=”post” AND post_status=”publish” GROUP BY year DESC” ); foreach ( $years as $year ) { // get posts for each year $posts_this_year = … Read more

Preventing 404 error on empty date archive

You can move the code from OP’s answer into a 404 template filter and force WP to load the date.php file instead of 404.php. It’ll still send the 404 header, but render the page with a different template. function wpd_date_404_template( $template=”” ){ global $wp_query; if( isset($wp_query->query[‘year’]) || isset($wp_query->query[‘monthnum’]) || isset($wp_query->query[‘day’]) ){ $template = locate_template( ‘date.php’, … Read more

How can I get the Month Name from Archive?

If you want to get the month of the current archive page you’ll have to use single_month_title. The following code will output ” August 2014″ (notice the space before the month) <?php single_month_title(‘ ‘) ?> Without a space before the month: <?php echo trim(single_month_title(‘ ‘,false)) ?> Read more: http://codex.wordpress.org/Function_Reference/single_month_title

WordPress Posts By Date/Day?

Not a bad idea for display of a blog home page and I would be interested in what you came up with, but thinking through the idea for implementation beyond the first page would be problematic: Pagination – If it is just the blog home then you can easily set an offset for starting on … Read more

How can I lock down an old wordpress install I don’t intend to update?

With a dynamic CMS like WordPress, there is no real way to “lock it down.” As the web evolves, formerly unknown security holes are discovered and patched in new versions. In reality, unless you’re always running the latest version of WordPress (currently 3.0.4), your site is in some way vulnerable. If you don’t intend to … Read more