WordPress.org

Ready to get started?Download WordPress

Forums

get the theme version (3 posts)

  1. Adam
    Member
    Posted 2 years ago #

    So essentially we use to do this:

    function get_current_theme_version(){
        $this->aisis_current_theme_version = get_theme_data(get_theme_root() . '/Aisis/style.css');
        return $this->aisis_current_theme_version['Version'];
    }

    which if your theme style.css said the version was 1.0 you would get 1.0 back. Now because get_theme_data is deprecated and we are to use wp_get_theme_data I thought I could do:

    function get_current_theme_version(){
        $this->aisis_current_theme_version = wp_get_theme(get_theme_root() . '/Aisis/style.css');
        return $this->aisis_current_theme_version['Version'];
    }

    nope....Doesn't work. I need to get the theme data and not have wordpress be like "thats wrong. your bad. no! don't do that!" So whats the "new" way to get the theme version?

  2. Adam
    Member
    Posted 2 years ago #

    never mind......the way I was doing it is right.

  3. Adam
    Member
    Posted 2 years ago #

    I was wrong yet again, not resolved. how do we get theme data now?

Topic Closed

This topic has been closed to new replies.

About this Topic