• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Posts stripping HTML tage

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Posts stripping HTML tage

This topic is: not resolved

Tagged: Excerpt, stripping html tags

  • This topic has 4 replies, 4 voices, and was last updated 10 years, 7 months ago by Boca.des.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • October 9, 2014 at 5:41 am #127191
    Boca.des
    Member

    How do I stop posts stripping HTML tags?

    http://local
    October 9, 2014 at 11:52 am #127218
    Marcy
    Participant

    You link to a site on your computer - local, so no one can see what you see.

    If HTML is being stripped, you are most likely using excerpts.

    Go to Genesis > Theme Settings and change Content Archives to be Display Post Content, and then set a limit of characters. Or you can add a "More" tag in every post and not set a character limit.


    Marcy | Amethyst Website Design | Twitter

    October 9, 2014 at 2:54 pm #127265
    lilifrancklyn
    Participant

    Yes I agree with Marcy. And, this is a WordPress issue, not a Genesis issue. The tags are stripped to remove the risk of the excerpt containing - say - one <div> tag which could break the whole site. So it's a kind of idiot-proofing.

    But, this is a real pain and I wish that the WordPress developers would figure out a way around this. Excerpts are REALLY useful and we should be able to use them in sidebars etc, so we can link back to the full post (which is what the default title of every post links to). With this tag-stripping limitation, you have to link to a SEPARATE post on the same topic if you want the piece in the sidebar to display properly.

    Crucible Communications

    October 9, 2014 at 3:20 pm #127273
    jodzeee
    Member

    You could try this plugin:

    Raw HTML

    October 9, 2014 at 3:54 pm #127279
    Boca.des
    Member

    I found this piece of code

    //* prevents excerpts from stripping html tags
    add_filter('get_the_content_limit_allowedtags', 'news_custom_allowedtags');
    function news_custom_allowedtags() {
    return '<script>,<style>,<b>,<br>,<em>,<h1>,<h2>,<h3>,<h4>,<h5>,<h6>,<class>'; 
    }

    But what I am trying to do is add classes to certain parts of the content displayed - The posts are being generated from filling in a form (gravity forms)... So it pulls a title, address, age etc - I want to style these individually? Do I need to add another template for this?

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble