WordPress.org

Ready to get started?Download WordPress

Forums

Meta Data question (WordPress to Facebook) (2 posts)

  1. markross1967
    Member
    Posted 2 years ago #

    Hi, I am using the below Meta Data code in my Header file. The code, for the most part, is working great. However, the only thing I am having a problem with is, when a single post is shared.

    In the below code example, under single, I have this line of code: <meta property="og:description" That is where I would like a post excerpt to be generated, when a post is shared on Facebook. I have tried a few WordPress tags, but, for some reason, the excerpt is being printed (echoed) just below my header, which, obviously, is not good. And, I don't know why that is happening.

    Then, as shown below, I currently have that line commented out, and it does generate the excerpt, except, the first line of the excerpt is saying, posted by 'author' on 'postdate,' which I also do not like.

    Can anybody please help me to get the just the first 30 or so characters from the 'body' of the post to display properly, using the below code, or something very similar?

    Thank you,
    Mark

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

  2. markross1967
    Member
    Posted 2 years ago #

    Here is the code I am inquiring about, in the above post:
    http://pastebin.com/4p1ySLCT

    Thank you,
    Mark

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.