WordPress.org

Ready to get started?Download WordPress

Forums

Single.php Line 11 (7 posts)

  1. calilandchic
    Member
    Posted 2 years ago #

    Hello! I am having trouble with a code in my wordpress, single.php page. My website is: http://www.cali-landchic.com

    When clicking on certain links with plugins (facebook share/nrelate/add a comment, etc.) the link goes to a blank page with the following code showing:
    Parse error: syntax error, unexpected '<' in /home/content/96/8886796/html/wp-content/themes/picture-perfect/single.php on line 11

    My line 11 code on single.php is:
    <p><?php the_content('<p class="serif">Read the rest of this entry ยป</p>');</p>

    When I remove this code all together and refresh, the link tries to find the post but comes back with just the title/author, etc. and no post content.

    Can someone please help me with what the code should be to get all these links working properly. I've been scratching my head for a few weeks now and have not gotten anywhere. Thanks in advance!

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    the error is likely to be caused by some code before that line 11 - please paste the full code of single.php into a http://pastebin.com/ and post the link to it here.

  3. calilandchic
    Member
    Posted 2 years ago #

    http://pastebin.com/wA13SYsb

    Does this work? Thanks for the reply. Hopefully we can work together to get this working. Let me know if you need anything else.
    Thanks!

  4. bjihalliday
    Member
    Posted 2 years ago #

    You have not closed the php on line 11

    <p><?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>');</p>

    It should read

    <p><?php the_content('<p class="serif">Read the rest of this entry &raquo;</p>');?></p>
  5. calilandchic
    Member
    Posted 2 years ago #

    Oh my gosh thank you.
    The related link works great, I hope you dont mind if I ask you another question...
    The AddThis facebook share and (maybe the other ones aren't working now).
    Could you offer me suggestions?
    Also the author name and date for post is not showing up underneath the title on the index page but it is working on actual post page and doubling the author name, like:
    Written by: Erin Erinon February 16, 2012.

    Again any help is appreciated.
    Thank you!

  6. bjihalliday
    Member
    Posted 2 years ago #

    You could try this as many of your php's do not end with a ; before the ?>

    Try checking over the author name etc and put in ; ?> at the end of the php codes.

  7. calilandchic
    Member
    Posted 2 years ago #

    Thanks for the advice! I will continue to look into the author problem I am having. It seems to be posting on the related page on the top and bottom, again doubling my name but not on the main page and not on all posts.
    I am very new to this so its a bit confusing.
    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic