Articles of archives

Insert static element only once in query archive

I’m looking to insert a foreign div-element only once in a archive query on my page. So that for example: Post1 Post2 [Static Div] Post4 Post5 …etc My query is: <?php $archive_args = array( post_type => ‘post’, ‘category_name’ => ‘category’, ‘posts_per_page’=> -1, ‘meta_key’ => ‘number’, ‘order’ => ‘ASC’ ); $archive_query = new WP_Query( $archive_args );?> […]

Multiple filters for wp_get_archive

I need to display custom posts archives on a page in the following format: Monthly – Grouped by Month for the Current Year. Annually – Grouped by Year & Month for all previous years So I have got two functions to do so, which supposed to be called in a row: function show_monthly_archive( $post_type ) […]

Sorting posts by season

What would be the best way to go about creating something like this ( in WordPress? This is a calendar, with posts (containing the event date and event description), separated by year. A thought doing something like this, but I do not know, if this is a good solution, or if it is possible: Creating […]

How can I get the query that would be run for the archive page?

When a user visits a post type archive page on my site, I’ve got a bunch of hooks and filters that run on that query and get it just so. How can I, in a different request, say “I want the query that would run when I go to /archives” so I can get those […]

Displaying year, month and day archives differently

I’d like to display daily archives differently than monthly/yearly archives. How do I check to see if the archive template is being pulled for a daily archive vs. a monthly/yearly archive?

Creating an Archive using a Custom Taxonomy

I recently adjusted the twentyten theme to display archives in a three column grid. In doing so, it seems that the archive has lost the ability to display posts from the specified taxonomy. For instance, a taxonomy type is ‘Flowers’, with a specific flower being ‘Rose’. When the ‘Rose’ archive is displayed, it simply lists […]

What is archive.php used for?

Dumb Questions Ahead: If index.php and archive.php are practically the same thing, what’s the point of having archive.php? When should I ever want to use archive.php over index.php? If I use front-page and Blog, it doesn’t switch to archive.php which you might expect to and then use index.php in the place of front-page.php.

How do I make archives.php for one category only?

I have a basic archives.php file. I was trying to get it to display only posts from category 1. When I do query_posts(‘cat=1’), the URL is then ignored and all posts in category 1 are displayed. For example, lets say I have one post in category 1: it’s called “testing post” and is dated November, […]

Optimal way to redirect home page to category archive?

Question What’d be an optimal way to redirect the home page of a WordPress site to a category archive without involving external factors (e.g. Apache’s .htaccess) i.e. within WordPress? Why? (Only to justify the question. Please let this not turn the question into too localized.) It’s a news site. The categories are used as Editions, […]

Custom Taxonomy Archive not displaying entries

I have CPT ‘movie’, with the following taxonomies: genre, director, and actor. The code used to register these is this: I have an archive movie page working using the following code in archie-movie.php: <?php get_header(); ?> <div id=”middle” class=”clearfix”> <div id=”inner”> <div id=”content” class=”<?php echo $bw; ?>”> <?php get_template_part( ‘part-genrenav’); ?> <div id=”pageHead”> <?php […]