• Hello,

    I am having an issue where the text for social networks is showing in my post excerpts. For example:

    Facebook Twitter Pinterest Linkedin Reddit TelegramI’ve been saying that Seoul has the most beautiful sunsets for years now. However, somehow, people still doubt that. This

    This should just display as

    I’ve been saying that Seoul has the most beautiful sunsets for years now. However, somehow, people still doubt that. This

    This doesn’t show on excerpts on the home screen, but it shows in my ‘related posts’ area at the bottom of posts. Is there any way to get the social network names to not display?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Robin Cornett

    (@littlerchicken)

    I can’t tell how your related posts are being built (whether it’s from your theme or coming from a plugin), so I can’t be of much help. I can offer some suggestions of where to start looking, which can hopefully get you started.

    The default method Scriptless uses for adding sharing buttons is by using the_content filter. That’s not usually used for things like excerpts, so I’m guessing the related posts are not using the standard WordPress excerpt. One option would be to use the scriptlesssocialsharing_locations filter (see the FAQ for an example) to pick a hook which runs only on your main entry content.

    I’m not sure what else to suggest beyond that–if you haven’t already modified the Scriptless output behavior (which is possible, but usually people only want that if they want to try to add buttons to their archives, so I’m guessing you haven’t), I would look into the related posts’ output. Scriptless makes multiple checks before deciding if the buttons can be added to the content: it checks to see if the main query is being run (which should not be true for related posts), and compares the current post ID with the queried ID (which determines what post to load), which also should not be true for related posts.

    The easiest/quickest fix while you look into those options would be to move the sharing buttons to the end of the post content, instead of the beginning, and then explore what hooks you might have available, or how to maybe tweak the related posts query.

Viewing 1 replies (of 1 total)
  • The topic ‘Text Showing in Post Excerpts’ is closed to new replies.