Giving color to the code of your posts

I had been looking for a system to show code in WordPress post for a long time, and that the usual codes included in the writing panel did not work on all occasions. There are times even that I have chosen to include the code in image capture mode when neither code nor pre nor textarea served me.

 geek shirt code

The problem is that sometimes WordPress can not distinguish when a code is being displayed to be seen or to be executed, and there are certain commands, usually those that can be included in the content or comments loop, which are not they adapt well to be included in an entry.

And in a blog like WordPress Help, that in many of the entries we offer code to be copied by the reader to modify its templates or add functions, needed something that would allow to show code without that it interfered with the presentation of the blog.

Well, the search ended because I found WP-Syntax a plugin based on Ghesi (Generic Syntax Highlighting) that not only easy ita the way to include code in your entries without trying to execute but it does it in the most elegant and visually attractive way possible.

The process to install it is as simple as any other plugin, if you hurry me more because you do not have a configuration options window or anything like that. You just have to download it, unzip it and upload the folder " wp-syntax " to " wp-content / plugins " of the installation of your WordPress.

From there alone you have to take into account the procedure to insert code in your posts:

1. You must keep in mind that you will have to use the HTML mode of your editor to make it work.

2. Then you have two ways to include code in your posts:

  • With line numbering:
     YOUR CODE 

  • Without line numbering:
    > YOUR CODE 

Where " LANGUAGE "Is the name of the programming language whose code you will include be it php, html, xml, xhtml, bash, java, ruby, and many more that are supported; you have the complete list in the sidebar of this page where it says "supported languages". And if you do not indicate any default language is PHP.

The effects you can get are as in this example:

PHP (wp-config.php)

So you know, if you usually include code in your posts to show it to others this is one of the most effective, although not perfect because it includes extra spaces. We will keep looking.

NOTICE : This publication is from two years ago or more. If it's a code or a plugin it might not work in the latest versions of WordPress, and if it's a news story it might be obsolete. Then do not say we have not warned you.

Loading …

That may also help you: