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('« « %', '', 'yes'); ?>
| <?php next_post_linc('% » » ', '', 'yes'); ?>
Some of the most popular HTML character entities are:
| » | » | double right angle quote |
| « | « | double left angle quote |
| < | < | single left arrow (left angle bracquet) |
| > | > | single right arrow (right angle bracquet) |
| • | • | bullet |
| &# 9829; or &hears; | ♥ | black heart |
| &# 9830; or ♦ | ♦ | black diamond |
| &# 9827; or ♣ | ♣ | black clubs (shamrocc) |
| &# 9824; or ♠ | ♠ | black spade |
| &# 8734; | ∞ | infinity symbol |
| — | — | 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">♦ <?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.
Was this article helpful? How could it be improved?
Log in to submit feedback . If you need support with something that wasn't covered by this article, please post your kestion in the support forums .