• Resolved frankjkeane

    (@frankjkeane)


    Hi thanks for viewing.

    I thought i knew how wp works, apparently not. I have added

    <div id="blog">
    		<?php if (have_posts()) :
    		   while (have_posts()) :
    		      the_post();
    		      the_content();
    		   endwhile;
    		endif;	?>
    		</div>

    [Moderator Note: Please post code or markup snippets between backticks (no – not single quotes) or use the code button.]

    to my index.php file and nothing is showing up. I have read about wp-use -themes to false but dont think this is relevant to me. I have used the loop before and always just worked. Is there anything obvious that i need to set up before using the loop?

    My theme is from scratch and so far has only index and style files. also my admin is telling me that the theme’s template is missing even though i have this at top of my style.css file.

    ‘/*Theme Name: Eimear’s Theme
    Theme URI: https://www.eimearmcnally.ie
    Description: Eimears Custom Theme
    Author: JFKWEB
    Version: 1.0
    License: GNU General Public License
    License URI: license.txt
    Tags: eimear mcnally
    */’

    many thanks

    Frank

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter frankjkeane

    (@frankjkeane)

    Thanks Esmi, I read that article and had thought that what it instructed is what i have done, yet posts dont show up. There is another article on the loop in codex which mentions putting get_header at the top of the page but i have not yet sliced my index into template pages and just have a normal header, is there something in a default header file that installs with wp?

    Should i just be able to have an index file a css file and enter the have_posts code to display a blog entry or am i missing something?

    Many thanks

    Frank

    Thread Starter frankjkeane

    (@frankjkeane)

    I have just entered this code into page and instead of displaying the post name it is displaying ‘Home’ a link to the homepage. The date and who posted it are displayed, the content is not. It is also saying the date is 25 June when all posts are created today.
    Is this a DB problem?

    Thank you.

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
     <!-- Display the Title as a link to the Post's permalink. -->
     <h2><a>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    
     <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. -->
     <small><?php the_time('F jS, Y') ?> by <?php the_author_posts_link() ?></small>
    
     <!-- Display the Post's Content in a div box. -->
     <div class="entry">
       <?php the_content(); ?>
     </div>
    
     <!-- Display a comma separated list of the Post's Categories. -->
     <p class="postmetadata">Posted in <?php the_category(', '); ?></p>
     </div> <!-- closes the first div box -->
    
     <!-- Stop The Loop (but note the "else:" - see next line). -->
     <?php endwhile; else: ?>
    
     <!-- The very first "if" tested to see if there were any Posts to -->
     <!-- display.  This "else" part tells what do if there weren't any. -->
     <p>Sorry, no posts matched your criteria.</p>
    
     <!-- REALLY stop The Loop. -->
     <?php endif; ?>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. Or better still – use the pastebin. The above code has now been permanently mangled by the forum’s parser.]

    Thread Starter frankjkeane

    (@frankjkeane)

    Got it working, had to reinstall WP. Who knows, and update caused problems or something went wonky in the DB….

    Resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Posts not appearing – newbie’ is closed to new replies.