Support » Fixing WordPress » HMTL in pages

  • We are working on rebuilding our company website and I am considering using wordpress as a CMS.

    I currently have a working version of the site built using my own html, php, and css the problem I am running into is I am having to put a lot of html tags, for classes and things of this nature, for instance I have a 12 column grid layout, I want one column to take up half the page and the another column to take up the other half, currently I just put a class name on the div to make this happen, no problem if you know how html and css work.

    I am worried that if I have to put this html and css tags into the post or page I create with wordpress someone who doesn’t know html and css would come along and accidentally mess things up. What I am wondering is if there is anyway around this, I am sure its not the first time something like this has happened, please let me know what solutions I should look into.

    Any help would be greatly appreciated.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You can disable the “HTML” tab from appearing in the content editor at all. Then, no one can mess with the class names or the CSS. All adjustments would need to be made with the “Visual” editor.

    Actually, the visual editor will make things worse, the use won’t be able to see your divs and will delete them inadvertently.

    What I do is add a bunch of shortcodes that let me define blocks with classes and ids. Since these are shortcodes they are visible to the user and they can edit the posts with the visual editor, and know to leave the blocks alone.

    I haven’t made a plugin out of this, but I probably should as I use it in almost every site I build.

    Yes I was afraid of turning of the html editor altogether as well. I haven’t looked into shortcodes much but it sounds like this might be a good solution for what I am looking for, thanks I will check it out.

    Also is common to put a lot of html code in the pages and posts or is it something people try to steer clear from? Or does it just depend?

    I guess it would depend on who you want to have access to the html. But, as Peter suggested, hiding all the HTML you don’t want users to see into a shortcode is a good solution.

    On my site, I’m the ONLY user… so ALL my pages contain the HTML. It would be an unnecessary extra step for me to use shortcodes.

    However, if I had dozens of other users who did not know HTML.. I would def use Peter’s suggestion.

    Thanks for the feedback, I think you are right if it were only me updating it there would be no problem, but since there could potentially be many people down the road who use it this might be a good way to lock down some of the pages and the code.

    Is this a common solution? I am fairly new to wordpres so want to make sure I am following best practices.

    Wrapping HTML snippets in short codes is a best practice. This way non-programmers can use them with less chance of breaking things. I always aim to allow uses to edit in the visual editor.If I’m forced to require them to use the HTML editor, I start thinking about a non-WordPress solution. A CMS is intended to make content editing easy for end uses.

    Thanks everyone for the replies and advice, I am going to work on the shortcodes.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘HMTL in pages’ is closed to new replies.