wordpress snippets last updated   : October 6, 2014
we now have 641 snippets

Display theme information with get_theme_data

wordpress snippet

Adding this snippet to your wordpress theme will let you display data from your theme file. name, title, uri, description, authorURI, template, version, status, tags, author. Change THEME_NAME to the name of your theme.

( example screenshot )
snippet :  PHPcopy
<?php
    $theme_data = get_theme_data(get_stylesheet_uri());
    echo $theme_data['Title'];
    echo $theme_data['Author'];
?>

Did you like this post? If so please share it with your friends. Thanks!

  • Gabriel Merovingi

    I love this feature!
    You can also call the css file by using get_stylesheet_uri() that way you don’t have to set the theme name:

    $theme_data = get_theme_data(get_stylesheet_uri());

    • http://wpsnipp.com Kevin Chard

      Ahh good call Gabriel ill have to update the post to include this method.

  • http://wpsnipp.com Kevin Chard

    Hi Cliff, technically you could however that would not be a good way of doing things. I would suggest using something like jquery to let people change stylesheets. This tutorial should help you get started with that.

    http://www.cssnewbie.com/simple-jquery-stylesheet-switcher/

jqsnipp.com | we just launched jquery snippets website