WordPress.org

Ready to get started?Download WordPress

Forums

unexpected T_ELSE - whats causing this please? (7 posts)

  1. elyonline
    Member
    Posted 9 years ago #

    Morning all,

    I am implementing Matt's Asides via this fine tutorial -http://fernando.dubtribe.com/archives/2004/10/28/using-matts-asides-with-kubrick/ - but I get a parse error....

    Parse error: parse error, unexpected T_ELSE in /home/public_html/news/wp-content/themes/eo_mrk2/index.php on line 48

    Line 48 is this: '<?php } else { ?>'

    This is my full index source.

    http://phpfi.com/62182

    Does it mean I need to add another 'else' somewhere?

    Thanks

  2. eridan
    Member
    Posted 9 years ago #

    as far as I can see you´re using else twice, line 38 and 48. That won´t work.

  3. elyonline
    Member
    Posted 9 years ago #

    Is there a way around this?

  4. eridan
    Member
    Posted 9 years ago #

    You could try removing line 48, I would guess it´s not needed. Since I haven´t looked into the code that much I´m not sure, but that´s what I would do.

  5. eridan
    Member
    Posted 9 years ago #

    hold on. Replace <?php } else { ?> with <?php } ?>

  6. elyonline
    Member
    Posted 9 years ago #

    Hi there,

    Thanks for that but it didn't work.

    Basically I am trying to say if we have 3 posts show them (Asides and other posts) otherwise show older entries as a list.

    Thanks

  7. elyonline
    Member
    Posted 9 years ago #

    Hi,

    Sorry to be a pain but I am no further forward here and my lack of knowledge is evident :)

    I think the problem lies here but not sure how to rectify:

    '<?php if ($i < 3) { ?>'

    '<?php if (in_category(25) && !$single) { ?>
    <ul class="asides">
    <li id="p<?php the_ID(); ?>"><?php echo wptexturize($post->post_content); echo ' '; comments_popup_link('(0)', '(1)', '(%)')?> <?php edit_post_link('(e)'); ?>

  8. '

    '<?php } else { ?>'

    '<h3 class="wp" id="post-<?php the_ID(); ?>">" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></h3>'

    '<p class="posted"> Posted <?php the_time('D F jS, Y') ?>, <?php time_of_day ($post->ID);?> by <?php the_author() ?>'

    '<?php the_content('<span class="more">Read full entry</span>'); ?>'

    '<p class="posted"><span class="file-img"><?php _e("Filed:"); ?> <?php the_category(',') ?></span> <span class="comm-img"><?php _e("Speak:"); ?></span> <?php comments_popup_link('Want to reply?', '1 Comment', '% Comments'); ?>'

    '<?php } else { ?>'

    '<?php if ($displayed == 'no') { ?>'

    Full code here: http://phpfi.com/62182

    Thanks :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.