News
: October 6, 2008 -
Submit Your Site for the October 2008 Site of the Month!
Home
Help
Search
Calendar
Login
Register
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
October 13, 2008, 07:38:25 AM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Web Hosting Forum | Lunarpages
>
Lunarpages Web Hosting - Online Help Desk
>
Lunarpages - Beginner Assistance
>
Wordpress "loop" won't work-help
Pages: [
1
]
Go Down
« previous
next »
Print
Author
Topic: Wordpress "loop" won't work-help (Read 223 times)
bonuscup
Newbie
Offline
Posts: 1
Wordpress "loop" won't work-help
«
on:
April 21, 2008, 12:34:34 AM »
Hello, I am having some trouble with the Wordpress "loop", specifically I am trying to insert it into my index.php file so it can call up my posts from Wordpress. I think I may be doing one or several things wrong here. When I put in this at the top:
< ?php
require('./blog/wp-blog-header.php');
?>
and then this in the body:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_date('','<h2>','</h2>'); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_tags(__('Tags: '), ', ', ' — '); ?> <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
<div class="storycontent">
<?php the_content(__('(more...)')); ?>
</div>
<div class="feedback">
<?php wp_link_pages(); ?>
<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
</div>
</div>
<?php comments_template(); // Get wp-comments.php template ?>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
It gives me an error message:
Fatal error: Call to undefined function: have_posts() in /home/myID/public_html/index.php on line 170
does anyone have any idea about this? I'm sure many people do but I am a complete noob. Please help!!
Logged
Mitch
Lunarpages Traffic Cop
Senior Moderator
Berserker Poster
Online
Posts: 7956
Re: Wordpress "loop" won't work-help
«
Reply #1 on:
April 21, 2008, 05:52:08 AM »
This page here should help with what you need to have inside of the loop:
http://codex.wordpress.org/The_Loop
Hope that helps!
Logged
Click Here for the Lunarforums FAQ - Read This BEFORE Posting!
+
Submit Your Site for the
Oct 08
Web Site of the Month Award!
+
Also Read the
SEPTEMBER 2008 Lunarpages Newsletter!
Mitch the Moderator
- Please Respect & Review the
Lunarforums Rules
Before Posting!
Lunarpages Web Hosting
|
Lunarpages Forums
|
Lunarpages Support Wiki
Need something to read? Try
Lunartics
&
the Lunarpages Newsletter
!
Pages: [
1
]
Go Up
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Lunarpages Web Hosting - Information & Opportunities
-----------------------------
=> Lunarpages Web Hosting - Announcements
=> Lunarpages Web Hosting - Hosting Plans & Site Information
=> Job Opportunities at Lunarpages Web Hosting
=> Lunarpages Web Hosting - Network Information
=> Lunarpages Web Hosting - Server Information
-----------------------------
Lunarpages Web Hosting - Before Signing Up
-----------------------------
=> Lunarpages Web Hosting Plans - Pre-Sales Questions
-----------------------------
Lunarpages Web Hosting - Online Help Desk
-----------------------------
=> Lunarpages - Webhosting Help
=> Lunarpages - Beginner Assistance
=> Lunarpages - How to's
=> E-mail with your Lunarpages Hosting Plan
=> Lunarpages - CPanel Help
=> Lunarpages - LPCP Beta
=> Lunarpages - Ecommerce Hosting
=> Lunarpages - FrontPage
=> Lunarpages - DreamWeaver
=> Lunarpages - Message Boards-Forums-Fantastico Scripts
===> Lunarpages - Joomla / Mambo
-----------------------------
Lunarpages Web Hosting - Advanced Assistance
-----------------------------
=> Web Management
=> Lunarpages - Webdesign and HTML
=> Lunarpages - Search Engine Optimization
=> Lunarpages - Animation & Flash
=> Lunarpages - Graphics
=> Lunarpages - Web Hosting, Email & PC Security
=> Lunarpages - Dedicated Web Hosting
===> Lunarpages - cPanel & WHM
===> Lunarpages - General
===> Lunarpages - Plesk
===> Lunarpages - Security
===> Lunarpages - Tutorials
===> Lunarpages - Webmin
=> Lunarpages - Reseller Web Hosting
===> Lunarpages - WHM
=> Lunarpages - VPS Hosting
=> Lunarpages - SharePoint Services (Beta)
-----------------------------
Lunarpages Web Hosting - Coding
-----------------------------
=> Lunarpages - ASP
=> Lunarpages - C++ / PERL / CGI
=> Lunarpages - PHP & MySQL
=> Lunarpages - Java Applets & Javascript
=> Lunarpages - JSP & Servlets
=> Lunarpages - Ruby Hosting
=> Lunarpages - Windows Development & Hosting
-----------------------------
Lunarpages Web Hosting - Entertainment
-----------------------------
=> Lunarpages - Chat & Stuff!
=> Lunarpages - Contests
=> Fun at Lunarpages!!
=> Lunarpages - Online Gaming
-----------------------------
Lunarpages Web Hosting - General
-----------------------------
=> Social Networking
=> Lunarpages Free Web Hosting - Education Program
=> Lunarpages - Affiliate Program
=> Introduce Yourself to the Lunarpages Forum Community!
=> Your Websites & Creations at Lunarpages!
=> Lunarpages Website of the Month
=> Lunarpages - Service and Trade
Loading...