Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 1 of 1

Thread: Archive Page

  1. #1
    Senior Member Hitch - CP's Avatar
    Join Date
    Jun 2009
    Location
    London
    Posts
    120
    Member #
    19164
    Hey Guys,

    Problem:
    Getting the Archives page to show a list of every single post if nothing specific has been selected (category, date). Currently, when landing on the archives page, there is not actually any information - please see link.

    Site:
    Archives - Collossal Pixel The Portfolio of Ali Hitch

    Info:
    When selecting a category or date from the archive section on the right sidebar (Filter Category / Filter Date) the archive.php file works perfectly and exactly as instructed to. But, when no specific archive section has been called upon, the archive page simply sits there in an extremely unuseful state - please see link.

    What I want to be able to do, is to have a list of every single archive post (formatting can come later) on this page. This will involve a load of PHP, which I am not that 'fluent' in. This will be the landing archive page, where anybody can see every post made, regardless of categories, tags or dates etc.

    The current PHP is as follows:

    Code:
    <?php /*Template Name: Archives*/
    ?>
    
    <?php get_header(); ?>
    
    <div class="b-wrap">
    
        <section class="a-wrap">
        
        <?php the_post(); ?>  
       
        <?php if ( is_day() ) : ?>
                    
            <div class="a-year">
        
            <h2 class="page-title"><?php printf(get_the_time(get_option('date_format')) ) ?></h2>
            
            </div><!-- .a-year -->
            
            <div class="line single-line"></div>
            
            <?php elseif ( is_month() ) : ?>
                        
                <div class="a-year">
            
                <h2 class="page-title"><?php printf(get_the_time('F Y') ) ?></h2>
                
                </div><!-- .a-year -->
                
                <div class="line single-line"></div>
                
            <?php elseif ( is_year() ) : ?>
            
                <div class="a-year">
            
                <h2><?php printf(get_the_time('Y')) ?></h2>
                
                </div><!-- a-year -->
                
                <div class="clear"></div>
                
                <div class="line single-line"></div>
                
            <?php elseif ( is_category() ) : ?>
            
                <div class="a-year">
            
                <h2><?php printf(the_category()) ?></h2>
                
                </div><!-- a-year -->
                            
                <div class="line single-line"></div>
                
            <?php elseif ( isset($_GET['paged']) && !empty($_GET['paged']) ) : ?>
            
                <h1 class="page-title"><?php _e( 'Blog Archives', 'your-theme' ) ?></h1>
            
        <?php endif; ?>
        
        <?php rewind_posts(); ?>
           
        <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
        
            <div id="nav-above" class="navigation">
            
            <div class="nav-previous">
                 <?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> Older posts', 'your-theme' )) ?>
            </div><!-- .nav-previous -->
            
            <div class="nav-next">
                 <?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&raquo;</span>', 'your-theme' )) ?>
            </div><!-- .nav-next -->
            
            </div><!-- #nav-above .navigation -->
            
        <?php } ?>  
        
        <?php while ( have_posts() ) : the_post(); ?>
    
            <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
            
                <div class="top-title">
            
                <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'your-theme'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
        
                <div class="entry-meta">
                    <span class="meta-prep meta-prep-entry-date"><?php _e('Published ', 'your-theme'); ?></span>
                    <span class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php the_time( get_option( 'date_format' ) ); ?></abbr></span>
                    <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t" ) ?>
                </div><!-- .entry-meta -->
                
                <div class="clear"></div>
                
                </div><!-- .top-title -->
            
                <div class="entry-summary">
                    <?php the_excerpt( __( 'Continue reading <span class="meta-nav">&raquo;</span>', 'your-theme' )  ); ?>
                </div><!-- .entry-summary -->
        
                <div class="entry-utility">
                    <span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'your-theme' ); ?></span><?php echo get_the_category_list(', '); ?></span>
                    <span class="meta-sep"> | </span>
                    <?php the_tags( '<span class="tag-links"><span class="entry-utility-prep entry-utility-prep-tag-links">' . __('Tagged ', 'your-theme' ) . '</span>', ", ", "</span>\n\t\t\t\t\t\t<span class=\"meta-sep\">|</span>\n" ) ?>
                    <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'your-theme' ), __( '1 Comment', 'your-theme' ), __( '% Comments', 'your-theme' ) ) ?></span>
                    <?php edit_post_link( __( 'Edit', 'your-theme' ), "<span class=\"meta-sep\">|</span>\n\t\t\t\t\t\t<span class=\"edit-link\">", "</span>\n\t\t\t\t\t\n" ) ?>
                </div><!-- #entry-utility -->
                
            </div><!-- #post-<?php the_ID(); ?> -->
    
        <?php endwhile; ?>  
    
        <?php global $wp_query; $total_pages = $wp_query->max_num_pages; if ( $total_pages > 1 ) { ?>
        
            <div id="nav-below" class="navigation">
            
                <div class="nav-previous">
                <?php next_posts_link(__( '<span class="meta-nav">&laquo;</span> Older posts', 'your-theme' )) ?>
                </div>
                
                <div class="nav-next">
                <?php previous_posts_link(__( 'Newer posts <span class="meta-nav">&raquo;</span>', 'your-theme' )) ?>
                </div>
            
            </div><!-- #nav-below -->
            
        <?php } ?>
        
        </section><!-- .a-wrap -->
        
        <?php include ('asider-r.php'); ?>
        
        <div class="clear"></div>
    
    </div><!-- .b-wrap -->    
    
    <?php get_footer(); ?>
    Hopefully I have explained this well enough for you to understand, but it's late and I'm tired so apologies if not!

    Many Thanks,
    Ali
    Ali Hitch

    Portfolio & Tutorial Site
    www.alihitch.com

  2.  


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:16 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com