Printing the category name using the category slug outside the loop

Description

After creating the category, use the exact name of the category slug in the code. In this example replace the word sprinter with the name of the slug you created.

PHP Source Code

                        
                          <?php
                    $category = get_category_by_slug( 'sprinter' );
                    if ( $category ) { 
                        echo  $category->name;
                    };
                    ?>                        
                        


Post Categories