Support » Themes and Templates » Does $themename still work on the frontend?

  • Resolved Iva

    (@supersonicsquirrel)


    I have created a new theme and wanted the theme name to be shown in the footer of every page.

    I used <?php echo $themename; ?>, but it doesn’t output anything. This worked in older versions of WordPress. Am I doing something wrong?

Viewing 5 replies - 1 through 5 (of 5 total)
  • esmi

    (@esmi)

    Forum Moderator

    <?php printf( __('Powered by the %1$s Theme %2$s'), '<a href="' . $my_theme_data['URI'] . '">' . get_current_theme(), '</a>');?>

    Iva

    (@supersonicsquirrel)

    Thank you so much. The name shows now.

    However, it outputs the current URL instead of the theme URL I specified in style.css …is that normal or am I supposed to specify the theme name somewhere else as well?

    I apologise if I’m being dumb.

    esmi

    (@esmi)

    Forum Moderator

    My bad. I missed out the first line in the paste:

    <?php $my_theme_data = get_theme_data(get_stylesheet_directory() . '/style.css');?>
    Iva

    (@supersonicsquirrel)

    I almost thought I was slightly challenged, since I managed to build an entire theme without any problems and now this happened.

    Thanks for the snippet and have a wonderful week. 🙂

    esmi

    (@esmi)

    Forum Moderator

    Glad I could help 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Does $themename still work on the frontend?’ is closed to new replies.