thurfjell Posted February 9, 2011 Share Posted February 9, 2011 I get the "Parse error: syntax error, unexpected T_ENDIF in /hsphere/local/home/x/x/links/wp-content/themes/x/single.php on line 58" error. I have highlighted line 58 below. What is wrong? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title><?php the_title(); ?> | X</title> <meta name="author" content="X" /> <meta name="description" content="X" /> <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" /> <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please --> <style type="text/css" media="screen"> @import url( <?php bloginfo('stylesheet_url'); ?> ); </style> <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="" /> <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" /> <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" /> </head> <div id="wrap"> <ul id="navbar"> <li><a href="http://x" alt="Index">Index</a></li> <li><a href="http://x/articles/" alt="Articles">Articles</a></li> <li><a href="http://x/links/" alt="Links">Links</a></li> <li><a href="http://x/contact/" alt="Contact">Contact</a></li> <li><a href="http://x/colophon/" alt="Colophon">Colophon</a></li> </ul> <img src="http://x/images/links.jpg" class="shadow" alt="Links of Plenty" width="640" height="320" /> <h1>Title</h1> <h4>Tagline</h4> <br> <div id="main"> <div id="content"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <?php if( in_category('ll') ) : ?> <h2 class="ll"><a href="<?php the_linked_list_link('url') ?>" rel="bookmark" title="Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <?php else : ?> <h2 class="title"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <?php endif; ?> <div class="meta"> <p>Posted on <?php the_time('M') ?> <?php the_time('d') ?> <?php the_time('Y') ?> | <a href="http://www.instapaper.com/hello2?url=<?= rawurlencode(get_permalink()) ?>&title=<?= rawurlencode(get_the_title()) ?>">Add to Instapaper</a> | <a href="http://twitter.com/share?url=<?php the_permalink() ?>">Share on Twitter</a></p> </div> <br> <div class="entry"> <?php the_content(__('Continue Reading »')); ?> <?php wp_link_pages(); ?> <a href="<?php the_permalink() ?>" rel="bookmark">⌘</a> </div> <br><p align="center"><a href="http://x/links/archives/">Browse by subject, year or month</a></p> </div> LINE 58 <?php endif; ?> </div> </div> <p id="footer"><a href="http://feeds.feedburner.com/x">Articles feed</a>. <a href="http://feeds.feedburner.com/x">Links feed</a>. <a href="http://feeds.feedburner.com/x"><a href="http://x/colophon/index.html#license">License</a>. Powered by <a href="http://www.wordpress.org">Wordpress</a> and <a href="http://x/">Coffee</a>. Built with <a href="http://macrabbit.com/espresso">Espresso</a>. <a href="http://x/links/wp-login.php">Admin</a>.</p> </div> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'x']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/227215-help-with-horrible-coding-woes-the-mythical-unexpected-t_endif/ Share on other sites More sharing options...
BlueSkyIS Posted February 9, 2011 Share Posted February 9, 2011 usually it means you are missing a closing } but i see you're using different if and looping structures than I'm use to. so, i guess it's a missing endif or loop closure. another reason to use blocks in {}, i guess. Quote Link to comment https://forums.phpfreaks.com/topic/227215-help-with-horrible-coding-woes-the-mythical-unexpected-t_endif/#findComment-1172073 Share on other sites More sharing options...
MadTechie Posted February 9, 2011 Share Posted February 9, 2011 looks like your missing <?php endwhile; ?> above the endif Quote Link to comment https://forums.phpfreaks.com/topic/227215-help-with-horrible-coding-woes-the-mythical-unexpected-t_endif/#findComment-1172078 Share on other sites More sharing options...
thurfjell Posted February 10, 2011 Author Share Posted February 10, 2011 looks like your missing <?php endwhile; ?> above the endif That seems to have done the trick. Thanks! My blog is now working - http://thurfjell.nu/links/ Quote Link to comment https://forums.phpfreaks.com/topic/227215-help-with-horrible-coding-woes-the-mythical-unexpected-t_endif/#findComment-1172457 Share on other sites More sharing options...
Maq Posted February 10, 2011 Share Posted February 10, 2011 looks like your missing <?php endwhile; ?> above the endif That seems to have done the trick. Thanks! My blog is now working - http://thurfjell.nu/links/ Cool You know, we have a Website Critique section in case you wanted people to check out your site: http://www.phpfreaks.com/forums/website-critique/ Quote Link to comment https://forums.phpfreaks.com/topic/227215-help-with-horrible-coding-woes-the-mythical-unexpected-t_endif/#findComment-1172501 Share on other sites More sharing options...
thurfjell Posted February 10, 2011 Author Share Posted February 10, 2011 looks like your missing <?php endwhile; ?> above the endif That seems to have done the trick. Thanks! My blog is now working - http://thurfjell.nu/links/ Cool You know, we have a Website Critique section in case you wanted people to check out your site: http://www.phpfreaks.com/forums/website-critique/ LOL. I´ll post it there as well. :-) Quote Link to comment https://forums.phpfreaks.com/topic/227215-help-with-horrible-coding-woes-the-mythical-unexpected-t_endif/#findComment-1172503 Share on other sites More sharing options...
Maq Posted February 10, 2011 Share Posted February 10, 2011 Only if you really want a critique. Quote Link to comment https://forums.phpfreaks.com/topic/227215-help-with-horrible-coding-woes-the-mythical-unexpected-t_endif/#findComment-1172505 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.