Pls look at code…WP_Loop not showing posts
-
If it helps, here is the entire index.php code. I didn’t place the <?php get_header(); ?> or <?php get_footer(); ?> yet until I get this piece working. Could that be the problem? I’ve done this before and it’s worked.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>My Blog</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link rel="stylesheet" href="style.css" /> </head> <body> <br /> <table width="890" align="center" style="background-color: #FFF"; cellpadding="7" cellspacing="0"><tr><td> <table width="100%" cellpadding="0" cellspacing="0" style="margin-bottom: 7px;"> <tr> <td style="padding-right: 7px;"><a href="index.html"><img src="images/logo.gif" width="300" height="73" alt="My Blog" border="0" /></a></td> <td style="background-image: url(images/pattern.gif);" width="100%"></td> </tr> </table> <table width="100%" border=3 cellpadding="0" cellspacing="0"> <tr> <td class="VertMenuLeftColumn"> <div class="VertMenuTitle2"></div> <!-- END VERTMENUTITLE2 --> <div class="VertMenuBox2"> <div id="nav"> <dl> <dt><a href="" title="Children">Item 1</a></dt> <dt><a href="" title="Children">Item 2</a></dt> <dt><a href="" title="Children">Item 3</a></dt> </dl> </div> </div> <!--End VertMenuBox2 --> <div style="background-image: url(images/gradient.gif); background-repeat: repeat-x;"> <img src="images/gradient.gif" alt="" border="0" /></a> </div> <img src="images/spacer.gif" width="186" height="1" alt="" /> </td> <td valign="top" width="100%" height="350"> <div style="background-color: #6C6C6C;"> <table cellpadding="0" border=0 cellspacing="0"> <tr> <td valign="top" class="Tab"><a href='' class='Tab'>Home</a></td> <td valign="top" class="Tab"><a href='' class='Tab'>About</a></td> <td valign="top" class="Tab"><a href='' class='Tab'>Shopping Cart</a></td> <td valign="top" class="Tab"><a href='' class='Tab'>Contact</a></td> </tr> </table> </div> <!-- END menu--> <div style="padding: 7px 0px 0px 7px;"> <h3 style="font-size: 14px;">Welcome to Cake Boutique</h3> INDEX.PHP in ROOT<br /> <p align="justify" style="font-size: 14px;"> <!-- WP LOOP START --> LOOP BEGINS HERE <br /> <?php if(have_posts()) : while(have_posts()) : the_post(); ?> YOU HAVE POSTS </p> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> YOU HAVE POSTS <?php the_title('<h2 class="entry-title"><a href="' . get_permalink() . '" title="' . the_title_attribute('echo=0') . '" rel="bookmark">', '</a></h2>'); ?> <p class="byline"> <span class="author vcard"><?php the_author_posts_link(); ?></span> <span class="sep">|</span> <abbr class="published" title="<?php the_time(__('l, F jS, Y, g:i a', 'example')); ?>"><?php the_time(__('F j, Y', 'example')); ?></abbr> <?php edit_post_link(__('Edit', 'example'), ' <span class="sep">|</span> <span class="edit">', '</span> '); ?> </p> <div class="entry-content"> <?php the_content(__('Continue reading', 'example')); ?> <?php wp_link_pages('before=<p class="pages">' . __('Pages:','example') . '&after=</p>'); ?> </div> <p class="entry-meta"> <span class="categories"><?php _e('Posted in', 'example'); ?> <?php the_category(', '); ?></span> <?php the_tags('<span class="tags"> <span class="sep">|</span> ' . __('Tagged', 'example') . ' ', ', ', '</span>'); ?> <span class="sep">|</span> <?php comments_popup_link(__('Leave a response', 'example'), __('1 Response', 'example'), __('% Responses', 'example'), 'comments-link', __('Comments closed', 'example')); ?> </p> </div> <?php endwhile; ?> <?php else : ?> NO POSTS <p class="no-posts"><?php _e('Sorry, no posts matched your criteria', 'example'); ?></p> <?php endif; ?> LOOP ENDS HERE <br /> <!-- WP LOOP END --> </td> </tr> <tr> <td class="VertMenuLeftColumn"> </td> <td class="newsletter"></td> </tr> </table> <br /> <div align="center"> <span class="address"><b>ADDRESS here</span><br /> <br /> <span class="copyright"> COPYRIGHT here </div> <br /> </body> </html>
The topic ‘Pls look at code…WP_Loop not showing posts’ is closed to new replies.