• Resolved Spencer Hill

    (@ws5f3dj7)


    So I’m working on this site: https://world-of-smiles.theportlandco.com/archives/64

    And the /archives page isn’t inheriting my archives.php file as it’s template and I don’t know why, can someone help?

    Here’s the code to archives.php:

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    /*
    Template Name: Archives
    */
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="https://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
    
    <head profile="https://gmpg.org/xfn/11">
    	<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
    	<title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
    	<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    
    	<script src="<?php bloginfo('template_directory'); ?>/scripts/css_browser_selector.js" type="text/javascript"></script>
    
    	<?php wp_head(); ?>
    
    </head>
    
    <body>
    <div class="wrapper">
    
    	<!-- BEGGINING OF ROW-1 -->
    	<!-- BEGGINING OF ROW-1 -->
    	<!-- BEGGINING OF ROW-1 -->
    	<div class="row-1">
    
    		<!-- BEGINNING OF ROW-1-COL-1 -->
    		<!-- BEGINNING OF ROW-1-COL-1 -->
    		<div class="row-1-col-1">
    			<p class="row-1-col-1-motto">Education and prevention lead to healthy smiles and happy kids.</p>
    
    			<img src="<?php bloginfo('template_directory'); ?>/image-rotator.php" alt="" />
    
    			<img src="<?php bloginfo('template_directory'); ?>/images/small-logo.gif" alt="World of Smiles Pediatric Dentisry Logo" />
    
    			<p class="row-1-col-1-address">11790 SW Barnes Road</p>
    			<p class="row-1-col-1-address">Building A, Suite 280</p>
    			<p class="row-1-col-1-address">Portland, OR 97225</p>
    			<p class="row-1-col-1-address">(503) 626-9700</p>
    		</div><!-- END OF ROW-1-COL-1 -->
    
    		<!-- BEGINNING OF ROW-1-COL-2 -->
    		<!-- BEGINNING OF ROW-1-COL-2 -->
    		<table cellpadding="0" cellspacing="0" style="float: left;">
    			<tr valign="top">
    				<td class="row-1-col-2" id="row-1-col-2-archives">
    					<img class="row-1-col-2-header" src="<?php bloginfo('template_directory'); ?>/images/row-1-col-2/archives-header.png" alt="" />
    
    					<p class="row-1-col-2-page-title"><?php echo wp_title("", false, ""); ?></p>
    
    					<span style="float: left; width: inherit;">
    
    <div id="content" class="widecolumn">
    
    <?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>
    
    					</span>
    				</td>
    			</tr>
    			<tr>
    				<td>
    					<img style="float: left; margin: 0 0 0 5px;" src="<?php bloginfo('template_directory'); ?>/images/row-1-col-2/archives-footer.png" alt="" />
    				</td>
    			</tr>
    		</table><!-- END OF ROW-1-COL-2 -->
    
    		<!-- BEGINNING OF ROW-1-COL-3 -->
    		<!-- BEGINNING OF ROW-1-COL-3 -->
    		<div class="row-1-col-3" id="row-1-col-3-archives">
    			<!-- This lists the navigation for all "Pages" within the account -->
    			<?php wp_list_pages('title_li'); ?>
    		</div><!-- END OF ROW-1-COL-3 -->
    	</div><!-- END OF ROW-1 -->
    
    	<!-- BEGINNING OF ROW-2 -->
    	<!-- BEGINNING OF ROW-2 -->
    	<!-- BEGINNING OF ROW-2 -->
    	<div class="row-2">
    		<p><a href="site-credits">Site Credits</a> :: &copy; World of Smiles <?php echo date("Y"); ?></p>
    	</div><!-- END OF ROW-2 -->
    
    </div>
    
    </body>
    </html>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi

    I don’t see the archives option on the site. However, just to review…

    You need to create WordPress static page that the archives template will be displayed on, and assign the template as a custom page template. Have you done this?

    See this page https://codex.www.ads-software.com/Creating_an_Archive_Index if you are not already familiar with it.

    Thread Starter Spencer Hill

    (@ws5f3dj7)

    Thanks for the reference. That’s relatively helpful but I’m still having the same issue. Let me rephrase my need though and see if it makes better sense:

    I want a page title “Blog” that can be accessed via /blog. This page should list the three most recent blogs, with their titles and tags. On this page should also be a “Categories” and “By Month” panel.

    I have a “Archives Index” page, via /archives-index using archives.php – Template Name: Archives. This page shows blogs by month and by subject, but no posts.

    If I change “Post Page” in the admin section to “Archives Index” then I get all my posts but no title, keywords, categories by subject or month.

    I can’t seem to figure out what I’m overlooking?

    Thread Starter Spencer Hill

    (@ws5f3dj7)

    Solution:

    I was told I need to create a page -> make that page the “Posts Page” (by selecting Settings -> Reading -> Posts Page -> “Example”). But I couldn’t get it to work properly (though I understand I’m simply overlooking something, no one was able to tell me what though.

    So I duplicated archive.php and imported it into my theme directory – making the applicable revisions – and discovered that this page lists all of my posts (or whatever number you set in Settings -> Reading -> Blog Pages Show At Most…) with their titles (linked to the single post – which utilizes single.php for those of you who haven’t referenced, or don’t understand, the WordPress Codex.), tags, comments, etc…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘archives.php file not working, need help…’ is closed to new replies.