WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] The Loop in WP 2.0.4 - Help! (11 posts)

  1. wmt
    Member
    Posted 8 years ago #

    Hi guys,

    I hope you can help me here.

    I've been trying to get the loop to work after upgrading to 2.0.4, but no matter which code I use, it still isn't working. I get this error using the older loop code (endforeach):

    Fatal error: Call to undefined function: _e() in /home/whistlem/public_html/index.php on line 12

    And this error when I use the newer loop code (endwhile):

    Fatal error: Call to undefined function: have_posts() in /home/whistlem/public_html/index.php on line 4

    This is my code (newer loop):

    <!------------START WORDPRESS CONTENTS----------------->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div align="center" class="top"><?php the_date('D d/m/y @ g:i a','','',true); ?></div>
    <div class="title"><?php the_title(); ?></div>
    <div class="head2">Filed under: <?php the_category(','); ?> && <?php comments_popup_link(__('C0MNTS'), __('C1MNTS'), __('C%MNTS')); ?></div>

    <div class="box"><?php the_content(); ?>
    <p align="center"><img src="plug.gif">: <?php mdv_comment_plugger(); ?>
    <?php comments_template(); ?></div>
    <?php endwhile; else: ?>
    <?php _e('Sorry, no posts matched your criteria.'); ?>
    <?php endif; ?>
    <!------------END WORDPRESS CONTENTS------------------->

    My website is http://www.whistlemytune.com

    Can anyone see the problem? It says there's a fatal error in the first line.

    Thanks to anyone who can help. =)

    Bekah
    -xxx-

  2. wmt
    Member
    Posted 8 years ago #

    Anyone?

  3. yosemite
    Member
    Posted 8 years ago #

    I think you may have an incomplete/corrupt file. When you upgraded, did you do the delete procedure?

  4. wmt
    Member
    Posted 8 years ago #

    Yes, I did. It upgraded fine, and I got the success message. I did have a little problem with the database, but sorted it.

    Should I just reinstall?

  5. geoffe
    Member
    Posted 8 years ago #

    The _e() function used to be in a file called wp-includes/wp-l10n.php which is going to be renamed to wp-includes/l10n.php.

    There should still be a reference in your wp-settings of
    require_once (ABSPATH . WPINC . '/wp-l10n.php');
    Perhaps your wp-settings.php in the wordpress root folder is the problem.

  6. wmt
    Member
    Posted 8 years ago #

    geoffe, I don't know what you're saying. I have that require_once (ABSPATH . WPINC . '/wp-l10n.php'); code in the wp-settings.php file. And I have a file called wp-includes/wp-l10n.php. Should this still be the problem?

  7. wmt
    Member
    Posted 8 years ago #

    *sigh* I've even tried it with a new database and brand new installation, and it still says the same thing. =( I'm beginning to give up on WP. But it's been so good to me! *cry*

  8. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    wmt: Some file somewhere in your installation is corrupt/short/bad/misnamed. Look for files with zero-byte sizes and reupload them from fresh versions. Failing that, reupload all the wordpress core files (everything in the wp-includes directory).

    Also check the permissions on all your files. You'll get the same sort of problems if the files are not readable due to incorrect permissions.

  9. wmt
    Member
    Posted 8 years ago #

    Thanks Otto42, but no. Your first suggestion didn't apply, and your second suggestion didn't work. :( Thanks anyway.

    How do I check the permissions?

  10. wmt
    Member
    Posted 8 years ago #

    Arrggghhhh!! I can't believe I've been so stupid. All I didn't do is add the <?php require("/home/whistlem/public_html/wp-blog-header.php"); ?> code at the top of my header.php page. Oh my God!!

    Can't. Believe. It.

    Thanks anyway, you guys. It's all sorted now. *kicks self*

  11. Samuel Wood (Otto)
    Tech Ninja
    Posted 8 years ago #

    You shouldn't need to have that at the top of your header.php page. It should be in your main directory's index.php page.

    You don't point the browser directly at the template. You point it at the root. It loads the template from there.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags