Extend the wp_get_archives output with ‘?post_type=foo’?

I’ve gotten my custom post types to display as it should in date based archives; the structure example.com/year/month/day (and above) works properly as long as it’s extended with ‘?post_type=post_type_name’. With Bainternets solution I’ve also gotten wp_get_archives to properly list archives based on whether or not they contain my CPT. The problem is that wp_get_archives still … Read more

Display only posts from referred category on date archive page

I am using wp_get_archive() in category.php. If I am on page of category=2 it should show my archives of only that category. However it is for all the categories. Following is the code for my category.php as well as archive.php <?php get_header(); ?> <?php $args =array( ‘posts_per_page’ =>1, ); $loop = new WP_Query( $args ); … Read more

How to replace a javascript select box onchange event to a form submit action?

I have a small problem that probably has a very simple fix. I have been using the wp_get_archives() function to produce a dropdown select form. See the full code below: <form id=”side-arch”> <select name=”archive-dropdown” onchange=”document.location.href=this.options[this.selectedIndex].value;”> <option value=””><?php echo esc_attr( __( ‘Select Month’ ) ); ?></option> <?php wp_get_archives( array( ‘type’ => ‘monthly’, ‘format’ => ‘option’, ‘show_post_count’ … Read more

wp_get_archives breakes Html5 validation

I have a issue with wp_get_archives because it breaks my Html5 validation. Inside validator I get this message: Bad value archives for attribute rel on element link: Not an absolute IRI. The string archives is not a registered keyword or absolute URL. My archive links looks like this: http://robertpeic.com/wordpress_template/2013/01/’ /> http://robertpeic.com/wordpress_template/2012/12/’ /> I am guessing … Read more

Limit WP_get_archives by category?

I have two categories on a site – news which contains news posts and blog – which contains blog posts. Each page has a wp_get_archives in the sidebar. I’d like to limit the archive listing by category but after looking at the codex this does not seem possible. http://codex.wordpress.org/Function_Reference/wp_get_archives <?php wp_get_archives(‘type=monthly&limit=12’); ?> That code lists … Read more