• Resolved greyBoston

    (@apollofletshqip)


    Hi,

    Can someone please help me how to add an archive page on my hueman themed blog?

    Thanks a lot

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    If I have understood your requirement right, you want to create a page which will list your posts by say month.

    By default, page.php in a theme takes care of displaying archives, tags, category etc., i.e. if you click on a category link displayed inside a post, it will open up a new page and list all posts under selected category.

    You can active Archives by using sidebar widget as well in general. However, if you want a separate page specific for displaying archives based on your custom criteria you need a file (page template) called page-archive.php inside your theme folder. In this file you need to write code to get your desired result.

    A typical archive page (page-archive.php template) can look like this:

    <?php
    /* 
    Template Name: Archives
    */
    get_header(); ?>
    
    <div id="primary" class="site-content">
    <div id="content" role="main">
    
    <?php while ( have_posts() ) : the_post(); ?>
    				
    <h1 class="entry-title"><?php the_title(); ?></h1>
    
    <div class="entry-content">
    
    <?php the_content(); ?>
    
    /* Custom Archives Functions Go Below this line */
    
    /* Custom Archives Functions Go Above this line */
    
    </div><!-- .entry-content -->
    
    <?php endwhile; // end of the loop. ?>
    
    </div><!-- #content -->
    </div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    

    To get more insight about WordPress template hierarchy you should read this:
    https://developer.www.ads-software.com/themes/basics/template-hierarchy/

    Thread Starter greyBoston

    (@apollofletshqip)

    Thank you very much but how I create a template archive file on wordpress.com? thank you!

    Hi,

    I don’t think Hueman theme is available on WordPress.com
    And you cannot edit or modify themes on WordPress.com

    Please see the difference.
    https://codex.www.ads-software.com/WordPress_vs_WordPress.com

    Thank you

    Thread Starter greyBoston

    (@apollofletshqip)

    I did find a solution in case anyone else looks for the same issue. the answer is – use a pluggin. The one I used is called Annual Archive and it worked perfectly.

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