WordPress:Fun 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 links. For instance, look at the the double left angle quotes («) and the double right angle quotes (») in this example:
These symbols are called HTML character entities or extended characters. They are generated by strange looking code on the web page that the web browser interprets as symbols.
The code that generated the above example looks like this:
<?php previous_post('« « %', '', 'yes'); ?> | <?php next_post('% » » ', '', 'yes'); ?>
Some of the most popular HTML character entities are:
- » » double right angle quote
- « « double left angle quote
- < < single left arrow
- > > single right arrow
- • • bullet
- ♥ or ♥ ♥ black heart
- ♦ or ♦ ♦ black diamond
- ♣ or ♣ ♣ black clubs (shamrock)
- ♠ or ♠ ♠ black spade
- ∞ ∞ infinity symbol
- — — long dash
Using Character Entities in WordPress
Using character entities can be a fun part of your design! You can use these special accents with template tags such as the the_category() tag. Note: the_category() template tag lists, in post meta data section, the various categories 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(' ♥ ') ?>
In this example you see the use of an accent in your post's title:
<?php the_title('∞ ', ' ∞'); ?>
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>
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, especially those tags that use boolean parameters. Test a template tag thoroughly to be sure that it will accept the symbols.