• Resolved wmt

    (@wmt)


    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 https://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-

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter wmt

    (@wmt)

    Anyone?

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

    Thread Starter wmt

    (@wmt)

    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?

    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.

    Thread Starter wmt

    (@wmt)

    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?

    Thread Starter wmt

    (@wmt)

    *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*

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    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.

    Thread Starter wmt

    (@wmt)

    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?

    Thread Starter wmt

    (@wmt)

    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*

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    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.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘The Loop in WP 2.0.4 – Help!’ is closed to new replies.