How do I get the parent theme's version in a child theme? I want to use it when loading the parent theme's stylesheet. Here's how I load the stylesheets in the child theme's functions.php file: function sometheme_enqueue_styles() { // Get parent theme version $parent_theme_version = wp_get_theme()->parent()->get( 'Version' ); // Load parent theme stylesheet wp_enqueue_style( 'sometheme-style', get_template_directory_uri() . '/style.css', array(), $parent_theme_version ); // Load child theme stylesheet wp_enqueue_style( 'sometheme-child-style', get_stylesheet_directory_uri() . '/style.css', array( 'sometheme-style' ), wp_get_theme()->get('Version') ); } add_action( 'wp_enqueue_scripts', 'sometheme_enqueue_styles', …
Is it possible to allow a user to select which theme they would like installed from the new site signup page? And once the site is created, it obviously installs whichever theme they chose. I found wp_get_themes. Is this how you would go about pre-populating a dropdown menu with all the available themes? How do you pass the theme's information to the actual signup process so the site is created with the correct theme? If someone knows how to do …
I want to to get the Author name of the Parent theme. I can get the theme name using wp_get_theme() to get the theme object of the current (child) theme. From this I can get the parent theme name. Next I think I need to get the object of the parent theme, but unsure how best to approach this. Here is my code so far: $style_parent_theme = wp_get_theme(); $style_parent_theme_dir = $style_parent_theme->get( 'Template' ); $style_parent_theme_name = wp_get_theme($parent_theme_dir); $style_parent_theme_author = $style_parent_theme_name->get( 'Author' …
This is what I want to accomplish. I've created a taxonomy called categorie with the terms app, web and branding. When a project has the term app, I want to load another theme / blog. When a project has the term web or branding, I want to load single.php. The last one works just fine. This is my code so far function load_single_template($template) { $new_template = ''; if( is_single() ) { global $post; if( has_term('app', 'categorie', $post) ) { $new_template …
in my one of my plugins i have modules (kind of like plugins in a plugin), is there a function like get_plugin_data() or wp_get_theme() that will allow me to get the header section of a custom file (by passing the path as a parameter)? By heading section i mean /* Plugin Name: Name Of The Plugin Plugin URI: http://URI_Of_Page_Describing_Plugin_and_Updates Description: A brief description of the Plugin. Version: The Plugin's Version Number, e.g.: 1.0 Author: Name Of The Plugin Author Author …
As of wordpress 3.4 we're supposed to use wp_get_theme to return theme data. $theme = wp_get_theme(); //var_dump($theme); echo $theme->Author; despite the var_dump indicating the correct string, $theme->Author always returns a hyperlink with the author's name, but linked to the author's site. how can i get just the theme's author name?