WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] atal error: Maximum execution time of 30 seconds exceeded yada yada (8 posts)

  1. buskerdog
    Member
    Posted 5 years ago #

    http://tinyurl.com/63b9e2

    The site is supposed to show the most recent posts on the front page but what's happening instead is just the most recent post over and over again until the error appears. I've seen:

    Fatal error: Maximum execution time of 30 seconds exceeded in /home/#######/public_html/wp-includes/query.php on line 522

    and someone else got

    Fatal error: Maximum execution time of 30 seconds exceeded in /home/########/public_html/wp-includes/plugin.php on line 274

    Any ideas? This is a pretty basic blog!

  2. buskerdog
    Member
    Posted 5 years ago #

    anyone?

  3. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    That would be caused by some missing tags/codes in the index page of your theme. Change design to default theme.
    - is this the first time you used your customized theme?
    - if theme was ok before, when this behavior start? new plugin? while customizing the theme?

  4. elfin
    Moderator
    Posted 5 years ago #

    hmmm - I would strongly suggest you cut down what is showing on the front page.

  5. buskerdog
    Member
    Posted 5 years ago #

    Well, it's only supposed to show the last 10 posts but instead it's looping the most recent post infinitely.

    This custom theme has been working. I don't know what changed (I set up the site, I don't maintain it)

    Here's the home.php

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    <div id="content">
    <?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>
    <?php if ( is_home() ) query_posts('posts_per_page=2'); else query_posts(); ?>
    <div class="post">
    <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    <div class="contenttext">
    <?php the_content('Read more &raquo;'); ?>
    </div>
    
    <p class="postinfo"><strong>Posted:</strong> <?php the_time('F jS, Y') ?> under <?php the_category(', ') ?>.<br />
    <?php the_tags('Tags: ', ', ', '<br />'); ?>
    <a href="<?php comments_link(); ?>"><strong>Comments:</strong> <?php comments_number('none','1','%'); ?></a>
    <?php edit_post_link('[e]',' | ',''); ?></p>
    </div>
    
    <?php endwhile; ?>
    
    <div class="navigation">
    <p><span class="prevlink"><?php next_posts_link('&laquo; Previous entries') ?></span>
    <span class="nextlink"><?php previous_posts_link('Next entries &raquo;') ?></span></p>
    </div>
    
    <?php else : ?>
    <h2>Not found!</h2>
    <p>Could not find the requested page. Use the navigation menu to find your target, or use the search box below:</p>
    <?php include (TEMPLATEPATH . "/searchform.php"); ?>
    <?php endif; ?>
    
    </div>
    <?php get_footer(); ?>
  6. elfin
    Moderator
    Posted 5 years ago #

    my apologies - hadn't noticed that.

    Without checking the code I'd suggest you compare it to the default themes templates to figure out where something is amiss.

  7. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    This custom theme has been working. I don't know what changed I set up the site, I don't maintain it

    If the code above was in your home.php even before then you would have had endless loop way back then. You say you did not change anything, then somebody else did. query_posts should be outside the WordPress loop. In this case, query_posts should have been placed before the WordPress loop
    See query_posts here

  8. buskerdog
    Member
    Posted 5 years ago #

    Boom! I think that solved it. Yeah, I don't know who was playing with it but there were a few other little changes that I probably wouldn't have noticed otherwise. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic