Support » Fixing WordPress » archive blog page

Viewing 2 replies - 1 through 2 (of 2 total)
  • Christine Rondeau


    Volunteer Forum Moderator

    The file that you want is called page-template-archives-php

    If you look at the source code, in the body tag, there are several classes added to it, one of which is page-template-archives-php which means that this page uses that template.

    Do display the archives, you need to use the function wp_get_archives()

    I am using this template, thank you. Where and how do i use function wp_get_archives()? Thank you so much for your help. If you need more files to look at, I can show you them here. This is what is contained in my Archive Page Template (archives.php):

    <?php /* Template Name: Archive */ ?>
    <?php get_header();?><!–content part–>
    <div class=”left_main_content_container”>
    <div id=”content” role=”main”>
    <div id=”breadcrumb”><?php the_breadcrumb(); ?>
    <h1 class=”entry-title”>
    printf( __( ‘Dr. S %s’, ‘mydigitallife’ ), ‘<span>’ . single_cat_title( ”, false ) . ‘</span>’ );
    <ul class=”archive-posts”>
    $query = “SELECT post_title, MONTH( post_date ) AS month , YEAR( post_date ) AS year, DAY( post_date ) AS day , id FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date <= now( ) and post_type = ‘post’ ORDER BY post_date DESC”;
    if ( $posts = $wpdb->get_results($query) ) {
    foreach ($posts as $post) {
    $categories = get_the_category($post->id);
    $category = $categories[0];
    $cat_id = $category->cat_ID;
    if ($cat_id!=6) {

  • id)?>”><?php echo $post->post_title ?>
    <span class=”date”><?php echo date(“j/n/y”,mktime(0, 0, 0, $post->month, $post->day, $post->year)) ?></span>
  • <div style=”height: 10px;”></div><HR WIDTH=”100%” SIZE=”1″ NOSHADE><div style=”height: 10px;”></div>

    <!– #content –>
    <?php get_sidebar(); ?>
    <!– content part end–>
    <?php get_footer(); ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘archive blog page’ is closed to new replies.