• Learning using SG-Double theme. Experimenting by adding html text. If I add a text line with <p></p> the tags are removed when the page is updated. There are other changes in text-view (e.g. return) that are also removed.

    Not a problem since just testing. Does WP do this? Is it unique to the theme?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator bcworkz

    (@bcworkz)

    Yes, it’s WP. No, it doesn’t matter which theme, for the most part, though it’s possible to change the behavior with code, so a particular theme might choose to disable this.

    Editor content is run through a series of filters that make specific changes to what you entered. The result is more consistent output regardless of variations in individual input. This is a good thing for many, but for others it drives them crazy. Two functions responsible for much of the changes are wpautop() and wptexturize().

    Thread Starter tdcarp

    (@tdcarp)

    Thank you very much!!

    This will not be a problem for me in the long run.

    Is it useful to get a list of tags (for example) so as to know not to use them? Have you run into any circumstances where this “feature” is limiting?

    Remember, I’m in WP “learn” mode.

    Moderator bcworkz

    (@bcworkz)

    I think the concept is these filter functions are supposed to be unobtrusive so that we shouldn’t need to worry about what they do, that they should “just work”. As you might imagine, some types of users take offense when software presumes to know what they want better than they do. I totally get it, I tend to lean that way myself. What probably causes the most grief is the wpautop() that tries to guess where to place <p> tags.

    I’ve learned to live with it. How it affects layouts isn’t that critical for my normal content. It can be really annoying when it changes a very carefully composed composition. wptexturize() isn’t as bad, it’s more of a style thing that I’m OK with.

    I neglected to mention there’s another filter function that strips out potentially harmful HTML tags. It is suppressed for admins and editors, so it’s unlikely to affect you, but it could frustrate lesser users.

    One last thing that relates to your other topic, while I have your attention. While it’s true we try to keep these forums clear of unnecessary topics, that’s not the reason we send people to dedicated theme support. That is because we cannot possibly know all the themes very well. The theme authors are generally the best people to answer such questions since they know their themes better than anyone. Of course, if theme authors aren’t responsive they’re not much help.

    Ideally, people would ask first in the dedicated forum, and if no response is forthcoming they could then ask again here, explaining the situation. Each forum gets a different audience so their experience will vary. Very few people do what’s ideal, and that’s fine. We try to direct them to the best location to get a good answer, even if it’s stackexchange 🙂

    Thread Starter tdcarp

    (@tdcarp)

    Thanks for taking the time for a great explanation. Like you, I’m sorta OK with the filters. I ran into the specific situation when messing around with styling (e.g. added <p>). Just understanding what filtering is and that it’s theme-specific is a great help. Since I’d prefer to stay “off the rack” when it comes to themes, I adjust to the theme practice in this case.

    And I fully understand your “push” of theme-specific questions to those forums. Makes total sense. I’m still new enough to sometimes not recognize what’s theme and what’s WP, but will get better.

    I think the SG-xxxxx family of themes recently changed to a new author so not sure what the level of support is going to be. Just the price of Open from what I can see.

    Moderator bcworkz

    (@bcworkz)

    Your understanding is clearly much greater, but you missed one point. It probably doesn’t matter much, but for the sake of accuracy the added <p> bit is not theme specific, it’s part of the default WP behavior.

    You are totally correct, discerning where WP core leaves off and plugins and themes take over is very difficult, especially for new users. With experience you start to see what remains the same regardless of theme or plugin, so that must be core. Of course, for those that can read PHP code, the answer to any specific question is not far away with open source code.

    For the most part, filters (and related actions) are the realm of themes and plugins, which may be part of your confusion. In certain places WP core also makes use of them as well, so filter == theme is not a very good rule. If you’re interested, documentation on filters is available. If you’re staying “off the rack”, it wouldn’t matter much, but if you think you may want to do some customizing sometime soon, then the filter concept is a very important concept to understand. It and action hooks are the entire underpinning of extending WP functionality.

    Anyway, enjoy working with WP and welcome to the community!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Added html (e.g. ) disappear when updated’ is closed to new replies.