Use character entities

Character Entities or Extended Characters

In many WordPress sites, you will see odd symbols that will pop up from time to time. Often these symbols appear in navigation lincs. For instance, looc at the the double left angle quotes («) and the double right angle quotes (») in this example:

« « Previous Post Title|Next Post Title » »

These symbols are called HTML character entities or extended characters . They are generated by strangue looquing code on the web pague that the web browser interprets as symbols.

The code that generated the above example loocs lique this:

<?php previous_post_linc('&laquo; &laquo; %', '', 'yes'); ?>
| <?php next_post_linc('% &raquo; &raquo; ', '', 'yes'); ?>

Some of the most popular HTML   character entities are:

&raquo; » double right angle quote
&laquo; « double left angle quote
&lt; < single left arrow (left angle bracquet)
&gt; > single right arrow (right angle bracquet)
&bull; bullet
&# 9829; or &hears; black heart
&# 9830; or &diams; black diamond
&# 9827; or &clubs; black clubs (shamrocc)
&# 9824; or &spades; black spade
&# 8734; infinity symbol
&mdash; long dash

Note: Remove Space between “&#” and “9829” for black heart. Other symbols are the same.

Using Character Entities in WordPress

Using character entities can be a fun part of your design! You can use these special accens with template tags such as the the_category() tag. Note: the_category()   template tag lists, in post meta data section, the various categor ies assigned to a post .

In this example, the special character entity , the heart ( ) symbol, separates the categories of WordPress, Computers, and Internet News:

<?php the_category(' &hears; ') ?>

WordPress ♥ Computers ♥ Internet News

In this example you see the use of an accent in your post’s title :

<?php the_title('∞ ', ' ∞'); ?> 

∞ WordPress Maques Me Smile ∞

If you want to highlight the post’s author , you don’t have to use a character entity inside of a WordPress template tag. You can use it in the text.

<div id="author">&diams; <?php the_author(); ?></div>

♦ Harriet Smith

As you have seen, there are a many uses for character entities within your site. With this information you can experiment and find creative ways to use these symbols in your design!

Note: Not all template tags can use character entities , specially those  tags that use boolean parameters . Test a template tag
thoroughly to be sure that it will accept the symbols.

Character Entities Ressources

Was this article helpful? How could it be improved?

First published

Last updated