Custom Archive Page

I highly recommend checking out the Smart Archives Reloaded plugin. It has several formats and one of them, called “fancy”, displays things very similar to what you described.

A problem with date archives

The problem is that the plugin only handles the calendar part, and not the archive query. What you need to do: Change the main query on archive pages if the post_type argument is present, eg: http://localhost:8888/wp/?m=201105&post_type=candy : add_filter(‘pre_get_posts’, ‘atom_include_cpt_in_archives’); function atom_include_cpt_in_archives($query){ // validate if(is_archive() && isset($_GET[‘post_type’]) && post_type_exists($_GET[‘post_type’])) $query->set(‘post_type’, $_GET[‘post_type’]); return $query; } Next, you’ll … Read more

How can I make different page templates for one category?

Make 1 template, and do a conditional on the meta info to either include a different stylesheet, or a entire different file altogether. $colour = get_post_meta(the_ID(), ‘color’); switch($color) { case ‘red’: include(‘category-car-red.php’); // or just different CSS break; case ‘green’: include(‘category-car-green.php’); // or just different CSS break; // etc }

Single page template

Yes, even for custom page templates, you will need to have a loop in order to get the title and content. Try the following: <?php /* Template Name: Use Case Template */ ?> <?php get_header(); ?> <div class=”wrap”> <?php if(have_posts()): while(have_posts()): the_post; ?> <div class=”leftcol”> <h3 class=”usehd”> <?php the_title(); ?> </h3> <div class=”hd-div”> </div> <div … Read more

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