Display raw code in WordPress posts

(by AXDS)

Displaying some HTML code, inside of a post that renders out HTML, is tricky.

In order to display the code for viewing rather than to run, we need to wrap WordPress tags around it.

Example:

scwp

 

 

 

Displays:

 

<div class="exampleDiv">Hello World</div>

 

The language can be selected to allow for syntax highlighting. The common languages are available such as ‘html’,’javascript’,’css’,’csharp’ etc. More are online.

Advertisements

How to: Create a WordPress post

(by AXDS)

The ‘Create a New Post’ button should be in the top right of the site. If it doesn’t appear you might not have author permissions in order to create posts.

wp1

Clicking this will take you to the post editor:

wp2

The image above shows the editor in the ‘Visual’ tab, this will give an idea of how the post will look. Sometimes this can be inaccurate, so take it as a rough estimate. The HTML tab allows you to create a post using element tags. You can also put scripts and code in this tab.

wp3

Once you’ve finished the post content, on the left hand side there is the menu for posting and tagging. Open up the ‘Categories & Tags’ section.

wp4

Pick or create some tags that are relevant to the post. This will allow the post to be categorised on the WordPress site,

wp5

Finally you can either preview the post, or go straight to the publishing

wp6

Tada!