• Hi.

    I am trying to paginate a large list but receive the following error:

    Parse error: syntax error, unexpected $end in /usr/local/apache/htdocs/html/lcm_dev/wp-content/plugins/exec-php/includes/runtime.php(42) : eval()’d code on line 7

    This is the code that I am using:

    <ul>
    <?php $i=0; $recent = new WP_Query("cat=13&showposts=-1"); while($recent->have_posts()) : $recent->the_post();?>
    <?php $i++;?>
    
    <li><div class="latest_icon"><?php get_cat_icon('priority="true"');?></div><div class="latest_info"><b><a><?php the_title(); ?></a></b><?php swift_list_cats(2); ?><?php the_modified_date(); ?></div></li>
    <?php if( $i%5==0): ?><!--nextpage--><?php endif; ?>
    <?php endwhile; ?>
    </ul>

    Any ideas?
    Many Thanks

Viewing 15 replies - 1 through 15 (of 43 total)
  • I don’t really know php well but I’m pretty sure you have either an extra endwhile or endif, probably the endif since you have no “if” statement in there, although you do have a “while” statement.

    Thread Starter rivkasa

    (@rivkasa)

    Nope. Code is find when I remove the <–nextpost–> πŸ™

    Have you reviewed the offending plugin exec-php? Also a post has a max size on servers (set in php.ini normally) review that.

    Thread Starter rivkasa

    (@rivkasa)

    The post isn’t very big and the problem specifically occurs with the <–nextpost–> tag (if I tell it to print something it works fine).

    What happens if you deactivate the plugin?

    Thread Starter rivkasa

    (@rivkasa)

    Wouldn’t the php code stop working if I deactivate it?

    Thread Starter rivkasa

    (@rivkasa)

    Wouldn’t the php code stop working altogether if I deactivate it?

    If using this plugin in the plugin gallery notes:

    Requires: 2.0.11 or higher
    Compatible up to: 2.8
    Last Updated: 2009-1-7

    You’re not running 2.8 or less also are you?

    http://codex.wordpress.org/Function_Reference/wp_link_pages

    Thread Starter rivkasa

    (@rivkasa)

    I’m running 3.2

    Forgot to keep thanking you for your time and effort btw πŸ™‚

    I think it’s a conflict with that plugin and now ‘built in’ shortcodes.

    Thread Starter rivkasa

    (@rivkasa)

    But if I replace it with the <!–More–> tag I don’t get an error

    They are not the same…it won’t hurt to deactivate the old plugin and see happens to rule out that is the issue.

    Thread Starter rivkasa

    (@rivkasa)

    no luck

    what does exec php do? I never realized <!–nextpage–> worked in php code, thought it was a kind of shortcode for the post editor.

    Maybe you need something like:

    <?php
    $limit = get_option('posts_per_page');
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('showposts=' . $limit . '&paged=' . $paged);
    $wp_query->is_archive = true; $wp_query->is_home = false;
    ?>

    It’s supposed to limit posts per page in a query and add the pagnation. I intend to try it myself asap.

    Thread Starter rivkasa

    (@rivkasa)

    Hi deepbevel

    Thanks for your reply.

    exec php lets you use php code in your wysiwyg editor and I’ve never had problems with it.

    I am trying to separate a large list into several pages so I am only dealing with one post.

Viewing 15 replies - 1 through 15 (of 43 total)
  • The topic ‘crashing site when used within loop displaying a list’ is closed to new replies.