• Resolved info303

    (@info303)


    When removing some google adsense from my index template I must have somehow deleted something or did something to cause an error. Because. . . when I updated and then went to view my blog I received the following error:

    Parse error: syntax error, unexpected T_ENDIF in /home/info303/public_html/wp-content/themes/iris/index.php on line 85

    Can someone please tell me where I can go to correct this and what to do once I get there? I cannot get back into the template through the WP dashboard. . . or rather, if I can, I don’t know how to do so. (lost internet connection while attempting to determine error in template through the dashboard) Now, when I try to go to my site all I get is the above error message.

    Thank you much,
    Charlsie (www.manifestinguniverse.com)

Viewing 15 replies - 1 through 15 (of 22 total)
  • Can you go into your host database and download the index file? If you can get to that, then I could look at the code and fine the error.

    Thread Starter info303

    (@info303)

    I’ve gone into my host database and was able to open the index file. Would it work for me to copy and paste the info. here. . . maybe that would be too much? Reason I ask is because I’m not sure I know how to download it. Please let me know and thank you much for your response.

    Can you go into your host database and download the index file

    Could you explain this, faustina???

    It just doesn’t make sense for me.
    If you screwed up your theme’s index file, just get a new copy of that theme and upload the uncorrupted file via FTP to your theme folder. That’s it. The theme template files are NOT in the database – whoever says that, is lying ??

    Thread Starter info303

    (@info303)

    Moshu, I have found the subject index file in cpanel of host server. So, it would be best to work with that, because previously I changed several things re: this index file. So, to put a ‘new’ copy of this would probably not allow blog to go back to how I had it. Like said before, I can paste it here for someone to take a ‘look see’. It is probably something really simple. . . I personally don’t have a clue!
    Thanks you. . . Charlsie

    Hey, Charlsie – don’t post that much code here please; post it to https://pastebin.com and post the link to it here, ‘kay? Thanks!

    yes, paste it there and then link us to it.

    Moshu – yes I did mean take the troubled file out of the ftp folder to copy and paste so we could see the error. All I know is from learning through doing myself so I don’t always use the correct term for things lol.

    Thread Starter info303

    (@info303)

    Thanks much faustina, moshu and vkaryl for your responses.

    I went over to pastebin.com, pasted in the info. and hit send. The message does not go anywhere. I noticed there is a note in the sidebar that there are ‘problems’ at the site.

    Or, perhaps I should have done more steps than what I did?

    Would it be possible for me to paste here and then delete after problem is resolved? Actually I could probably just paste the last 6 lines or so of the content since the error is on line 85. Would that be okay?

    Thank you, Charlsie

    Few lines is fine…. 85 isn’t, so yeah, post a few and we’ll see. (Pastebin is public, and unpaid, so occasionally they have troubles….)

    sounds like you deleted (or partially delted) this line:

    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>

    it’s the beginning of the Loop. Should be close to the top of your posts.

    Thread Starter info303

    (@info303)

    Thank you. I started with the final line of google adsense and think the error is somewhere below this line.

    src=”https://pagead2.googlesyndication.com/pagead/show_ads.js”&gt;
    </script><br>

    <?php _e(‘Sorry, no posts matched your criteria.’);?>

    <?php endif; ?>

    <?php posts_nav_link(‘ — ‘, __(‘« Previous Page’), __(‘Next Page »’)); ?>

    <?php get_footer(); ?>

    There are more pastebin services:
    https://www.google.ca/search?q=pastebin

    faustina, I appreciate your willingness to help – but I prefer to use the correct terminology, sorry. FTP and the database have nothing to do with each other! A wrong advice can destroy a blog, so, please, try to learn the basics about the web “things” related to WP ??

    Just trying to help, I will stay out of it now I suppose, no one had responded and I knew what she was asking so I got it started at least.

    Thread Starter info303

    (@info303)

    doodlebee,
    The line you reference wasn’t deleted. Thank you, though. Any more possibles?
    Since error is supposedly on line 85 that puts it near the end of content. . . maybe 3 or 4 lines up from bottom.

    >>Since error is supposedly on line 85 <<

    The error is the line <?php endif; ?>. Which is what it’s telling you. The *reason* you’re getting that line as an error is because you’re ending something that isn’t open. So in your code, you had something that started

    <?php if ....

    Perhaps the line I stated was there, but if you look further down, there may be an “else” or “while” statement that’s left hanging open or missing.

    Line 85 is an error, but only because there’s some other line somewhere else that’s *making* that line an error. (Hopefully you get what I mean!)

    Perhaps if you just copy and paste *only* the PHP code (remove all the extra junk) in your index file, then we could see the issue? Or, even better (since you can’t seem to use Pastebin), make a copy of your index.php file and rename it “index.txt” and upload it so we can see it.

    Thread Starter info303

    (@info303)

    Would it be okay for me to just give you the link directly to the file. . . here? Don’t know if that violates any rules, so wanted to ask first. I’m not tech savy enought to be renaming files, and such. . . perhaps if my mind was not very, very tired about now!

    My printer is broken so I can’t print off the original template prior my making changes, and then compare. I can switch window to window, though, and start comparing.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘error in index template’ is closed to new replies.