• Ok so at my work we have a login that takes someone straight into an editable post.

    Each day this post gets edited because we operate a frozen yogurt company that changes flavors every day.

    Here’s an example of one post

    • <span style=”color: #ed1c24;”>test flavor 1;</span> Description shows up here.
    • <span style=”color: #ed1c24;”>Test flavor 2;</span> Description shows up here.
    • <span style=”color: #ed1c24;”>test flavor 3;</span> Description shows up here.
    • <span style=”color: #ed1c24;”>Test flavor 4;</span> Description shows up here.
    • <span style=”color: #ed1c24;”>test flavor 5;</span> Description shows up here.
    • <span style=”color: #ed1c24;”>Test flavor 6;</span> Description shows up here.

    Now everything displays how we want it, the problem we’re having is when someone is editing the post in visual mode and either erase too much or copy paste, it’s ruining the formatting and causing the results to be inconsistent. What can I do to make the code uneditable but that actual text editable?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can move the CSS into a stylesheet.

    If you’re not using a Child Theme, and if the theme doesn’t have a designated section of the dashboard for CSS modifications then install this Custom CSS Manager plugin http://wordpress.org/plugins/custom-css-manager-plugin

    Then use its “CSS Code” section of the dashboard to hold your CSS modifications.

    Alternatively use your Child Theme style.css file to hold your CSS modifications.

    You could disable the visual editor for the users who need to update that page. The CSS would still be editable, but the formatting wouldn’t accidentally get updated by the visual editor.
    Just update the option on the user’s profile – see screenshot

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Stop HTML code from being edited in WordPress Post’ is closed to new replies.