Adding HTML To WordPress Widgets Without Knowing HTML

Good tip for HTML novices…

WordPress: Tip on How to Insert HTML Code

Ethemed video tutorial on a great tip on how to insert html code into your WordPress website.

If you know nothing about HTML, it can be intimidating to try to add some code when you actually need to. The technique the author shows in this video is a good one for more than one reason.
First,it does give you the correct HTML code for whatever you enter into the editor without fuss.
Second, this trick gives you HTML the particular way it’s done in¬†WordPress, which is not the same as you would find in a true HTML site.
And last but not least, by studying the code you copy from the HTML you can begin to understand how HTML code works.

I have done a variation on this for years to create more complex HTML code. Personally, I prefer to right click on the post tab and open the “new post” page in another browser tab. That way if you don’t like the way everything looks you can easily make changes and replace the code you pasted earlier with the edited code. This really comes in handy if the widget you are working with has a narrow width.

Keep in mind that trying to add pure HTMl like a HTML sales page to a post or page in WordPress is not this easy.

This technique works for two reasons. The HTML code is being added to a text widget. This widget is set up to allow either pure text or HTML code. You could add text right from a HTML Editor to the text widget and it would display it properly. Try that in a post, and the built in WordPress filters would kick in and strip the HTML from the post. The HTML in WordPress must function within a PHP framework, so it is very simply written. If you were to try building a HTML Web site with the WordPress version of HTML the result would be painfully basic. The HTML in WordPress only applies to what you put in the editor screen.

Next time we will look at adding HTML to a post or page in WordPress.

Comments

comments