{"id":11248870,"date":"2019-02-27T14:48:15","date_gmt":"2019-02-27T14:48:15","guid":{"rendered":"https:\/\/wordpress.org\/support\/?post_type=helphub_article&p=11248870"},"modified":"2023-01-12T21:26:58","modified_gmt":"2023-01-12T21:26:58","slug":"use-character-entities","status":"publish","type":"helphub_article","link":"https:\/\/wordpress.org\/documentation\/article\/use-character-entities\/","title":{"rendered":"Use character entities"},"content":{"rendered":"\n

Character Entities or Extended Characters<\/h2>\n\n\n\n

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 (\u00ab)<\/strong> and the double right angle quotes (\u00bb)<\/strong> in this example:<\/p>\n\n\n\n

\u00ab \u00ab Previous Post Title<\/a>    |    Next Post Title \u00bb \u00bb<\/a><\/pre>\n\n\n\n

These symbols are called HTML<\/a> character entities<\/strong> or extended characters<\/strong>. They are generated by strange looking code on the web page that the web browser interprets as symbols.<\/p>\n\n\n\n

The code that generated the above example looks like this:<\/p>\n\n\n\n

<?php previous_post_link('&laquo; &laquo;\u00a0%', '', 'yes');\u00a0?>\n| <?php next_post_link('% &raquo; &raquo; ', '', 'yes');\u00a0?><\/pre>\n\n\n\n

Some of the most popular HTML<\/a> character entities<\/em> are:<\/p>\n\n\n\n

&raquo; <\/td>\u00bb<\/td>double right angle quote <\/td><\/tr>
&laquo;<\/td>\u00ab<\/td>double left angle quote <\/td><\/tr>
&lt;<\/td><<\/td>single left arrow (left angle bracket)<\/td><\/tr>
&gt; <\/td>><\/td>single right arrow (right angle bracket)<\/td><\/tr>
&bull; <\/td>\u2022<\/td>bullet<\/td><\/tr>
&# 9829; or &hearts; <\/td>\u2665<\/td>black heart<\/td><\/tr>
&# 9830; or &diams;<\/td>\u2666<\/td>black diamond<\/td><\/tr>
&# 9827; or &clubs; <\/td>\u2663<\/td>black clubs (shamrock)<\/td><\/tr>
&# 9824; or &spades;<\/td>\u2660<\/td>black spade<\/td><\/tr>
&# 8734;<\/td>\u221e<\/td>infinity symbol<\/td><\/tr>
&mdash;<\/td>\u2014<\/td>long dash<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

Note: Remove Space between “&#” and “9829” for black heart. Other symbols are the same.<\/p>\n\n\n\n

Using Character Entities in WordPress<\/h2>\n\n\n\n

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

In this example, the special character entity<\/em>, the heart (\u2665<\/strong>) symbol, separates the categories<\/a> of WordPress, Computers, and Internet News:<\/p>\n\n\n\n

<?php the_category(' &hearts; ') ?><\/pre>\n\n\n\n

WordPress \u2665 Computers \u2665 Internet News<\/p>\n\n\n\n

In this example you see the use of an accent in your post’s title<\/a>:<\/p>\n\n\n\n

<?php the_title('\u221e ', ' \u221e'); ?> <\/pre>\n\n\n\n

\u221e WordPress Makes Me Smile \u221e<\/p>\n\n\n\n

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

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

\u2666 Harriet Smith<\/p>\n\n\n\n

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

Note:<\/strong> Not all template tags<\/a> can use character entities<\/em>, especially those tags<\/a> that use boolean parameters<\/a>. Test a template tag<\/a>
thoroughly<\/strong> to be sure that it will accept the symbols.<\/p>\n\n\n\n

Character Entities Resources<\/h2>\n\n\n\n