Forums

The Loop (I think) (2 posts)

  1. iamelwood
    Member
    Posted 3 years ago #

    Please forgive me if this question has been asked before.. .

    You have the function of the default theme's index.php

    <?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<small><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></small>
    
    				<div class="entry">
    					<?php the_content('Read the rest of this entry &raquo;'); ?>
    				</div>
    
    				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    
    	<?php else : ?>
    
    		<h2 class="center">Not Found</h2>
    		<p class="center">Sorry, but you are looking for something that isn't here.</p>
    		<?php get_search_form(); ?>
    
    	<?php endif; ?>

    Which in displays all the posts made.
    I am trying to make a different page perform this function (blog.php), but I get this error:

    Fatal error: Call to undefined function: get_header() in /home/content/a/a/a/aaaaaaaa/html/wp-content/themes/themename/blog.php on line 7

    Thank you for any help on this issue.

    Steve

  2. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    It might be a lot more useful if you placed a copy of your custom blog.php in the Pastebin. People need to see your file's contents to have any hope of identifying the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags