• Resolved gmatoka

    (@gmatoka)


    In the WP Codex documentation, WordPress Lessons->Fun Character Entities->Using Character Entities in WordPress, one of the examples shows how to insert special characters as separators in a list: ‘<?php the_category(‘ ♥ ‘) ?> ‘. Where would this code get placed within the theme in order to generate the category list as shown in the example?

Viewing 4 replies - 1 through 4 (of 4 total)
  • It depends where you want it to display ??

    <?php the_category(' ? ') ?> could be inserted on a page where <?php the_category() ?> is used and would insert ♥ in between each category that is output. &hearts could also be used in HTML code.

    Thread Starter gmatoka

    (@gmatoka)

    I wanted to use it on my home page as part of a description of my web site layout. For instance, I inserted this code: ‘<p>And the categories are: <?php the_category(‘ ? ‘) ?> </p>’. Although the paragraph “And the categories are:” displays fine, the category list isn’t getting generated.

    Does this mean that I can only use it where the_category function is currently being used?

    replace yours with this <?php the_category(' &hearts; ') ?> where you want the categories to output.

    Make sure you include the semicolon after &hearts with no spaces.

    Thread Starter gmatoka

    (@gmatoka)

    Keith – OK thanks for the assistance.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Where to insert special character code?’ is closed to new replies.