Possibly one of many least used features in all of WordPress is the Class Description.
A lot of chances are you’ll be saying, “The what?”
Though it could not sound acquainted, you’ve most likely seen the sector for the class description numerous occasions. It’s that field that almost all of us skip over once we’re organising or enhancing our classes.
When you fill that field in, nonetheless, you’ll be able to then show what’s written in it with the next piece of code (supplied your theme doesn’t already use the class description perform, as many don’t). Simply put this in your theme wherever you’d like – for instance, on the prime of your class template (normally class.php or archive.php).
<?php echo category_description( $category_id ); ?>
Right here’s a fast instance. I stuffed out my class description area after which I positioned the code above in my archive.php file.
Utilizing HTML in Your Class Description
By default you can’t use HTML in your class description area. Nevertheless, there’s a workaround for that. Merely put the next in your features.php file after the opening <? php. (Look > Editor > Theme Capabilities – features.php)
When you’ve carried out that, you’ll be able to insert no matter HTML you want in your description field. Right here’s an instance of a headline, a picture, and wrapped textual content on the prime of a class web page.
Why Use a Class Description
Not everybody will want or desire a class description, however it might be able to brighten up your website (particularly in the event you use HTML), give your customers helpful info, and naturally, it could even assist out the search engine marketing of your class pages.