• Currently, all content including headers (<h1>, <h2>, etc.) appears in the feed, making for awkward reading of my home page. Is there an easy way to hide all headers just on the article summary on the home page?

    I probably could create a custom page and use a custom filter php function to str_replace the header content but that seems overly complicated.

    • This topic was modified 7 years, 7 months ago by wemba32.
    • This topic was modified 7 years, 7 months ago by wemba32.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Kathryn Presner

    (@zoonini)

    HTML code shouldn’t normally be output in feeds. The blog feed is generated by WordPress core, and isn’t theme-specific. Does the problem persist if you switch themes?

    Could you provide a link to the site so I can take a look?

    Thread Starter wemba32

    (@wemba32)

    Please see the home/category pages of https://freetime.mikeconnelly.net

    To be clear, it’s not HTML code appearing on those pages. Rather, it’s that the Canard theme shows all content including the content in HTML headings as if it were originally written as one paragraph.

    This can make for awkward reading, which is why I would like to suppress content in the headings for the home/category pages.

    By comparison, the 2017 theme also outputs the HTML headings but it doesn’t condense everything into a single paragraph, minus styling.

    Moderator Kathryn Presner

    (@zoonini)

    Thanks for clarifying! Now I see that you meant the blog page, and not the XML feed as I’d originally understood, so this is helpful. ??

    Automatic excerpts in WordPress do not parse HTML code or embeds, which I think explains what you’re seeing. There are a couple of possible workarounds you could try. They’re different than your solution of stripping out heading tags, but might solve the issue in a different way:

    – Add a custom excerpt to each post by writing one in the excerpt box below the post editor. This lets you control which text you want displayed on the blog and category pages.
    – If you have a lot of posts and don’t want to go back and add custom excerpts to each one, you could try a plugin like Advanced Excerpts, which preserves HTML parsing in the automated excerpt.

    Let me know how it goes.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hiding headers from the content feed’ is closed to new replies.