• Hello,

    I’m attempting to create a custom archive page. I thought I knew how to do this so I just coded one up. That page yielded some wonky results with sidebars missing, no margin and text in the wrong spot. So I failed to my good friend Google and sought out some greater insight. I found a couple of pre-baked pages and used one of those for testing. I’m getting the exact same result with that.

    Here’s the code I’m using

    <?php
    /*
    Template Name: Archives
    */
    get_header(); ?>
    
    <div id="container">
    	<div id="content" role="main">
    
    		<?php the_post(); ?>
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    		
    		<?php get_search_form(); ?>
    		
    		<h2>Archives by Month:</h2>
    		<ul>
    			<?php wp_get_archives('type=monthly'); ?>
    		</ul>
    		
    		<h2>Archives by Subject:</h2>
    		<ul>
    			 <?php wp_list_categories(); ?>
    		</ul>
    
    	</div><!-- #content -->
    </div><!-- #container -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    from https://codex.wordpress.org/Creating_an_Archive_Index.

    The results are a malformed page with no border on the content column, the left sidebar below the content and the right sidebar missing altogether. I can’t figure out what’s going on. I’ve pulled a couple of existing templates to try and get this working and had the same results with all of them. If I try and use eithe the hu_get_template_part or hu_get_content it seems as though my widget calls are being ignored altogether. Any help is much appreciated.

    Thanks
    Ben

    The page I need help with: [log in to see the link]

The topic ‘Custom Archive Page, not working’ is closed to new replies.