You cannot access the $headers
property as it is a private property.
Members declared as private may only be accessed by the class that defines the member
For that reason, you get NULL
when you try to access the property with wp_get_theme()->headers
. You need to make use of the magic __get()
method of the class to get the info you are after.
Example: (From the codex page, wp_get_theme()
)
<?php
$my_theme = wp_get_theme();
echo $my_theme->get( 'TextDomain' );
echo $my_theme->get( 'ThemeURI' );
?>
Related Posts:
- Using OOP in themes
- How to change background color in the Notepad++ text editor?
- What are all the available parameters for query_posts?
- Does WordPress work without a theme?
- Is it OK to remove theme credits from footer? [duplicate]
- What theme is good for posting code? [closed]
- Difference between stylesheet_directory and template_directory
- Adding a Template to the Page Attributes Panel for both Posts and Pages?
- How to see files in directories in “Edit Themes” screen
- WordPress generating 404 on .mp4 file in theme folder
- Why are my widgets not saving when being added to a sidebar?
- Building useful features into your theme
- How to remove “Proudly powered by WordPress” in Twenty Sixteen (2016) theme?
- How to create a theme option-menu page to save user values
- Are custom inner theme folders in any way overridable by child themes?
- How to put a banner ad between post 1 and post 2 on homepage only
- How to reverse the pagination numbers of an archive?
- In which directory do I find a specific HTML code of my wordpress page? Some of it seems to be missing after checking all pages [closed]
- Why do Trackbacks/Pingbacks not appear below my posts/pages?
- Extra themes – ok or bad?
- WordPress AJAX in header.php
- Add transparency to wordpress color picker?
- Theme Customizer – How to create a sub panel
- Setting a static home page and blog page without using the settings
- Can’t Install Child Theme “The parent theme is missing. Please install the “Default” parent theme.”
- Why is WordPress asking me to update my new (virtually blank) theme?
- How to find a file in WordPress themes [closed]
- Change title slug or separator in WordPress
- How to configure PoEdit to pick up translation string?
- Can i have a single wordpress site to have two themes ( one for pc other for mobiles)
- Translated my theme (translation not showing up)
- How to use get_page_by_title() with qTranslate?
- Changing $before_widget for certain widgets
- wp theme.. Could not create directory
- Free themes for commercial use
- Should a child theme share the same theme options row as the parent, or should it have it’s own options row?
- Multi-level page hierarchy
- Installed theme uses get_template_directory, breaks WordPress on Windows
- How to conditionally display widgetized areas in theme customizer?
- How prevent someone from opening my theme directory
- loss of theme options while site deployment in production
- How to install WordPress theme and configure it? [closed]
- How do I get rid of or change the footer in my child theme?
- Categories gone after changing theme / demos [closed]
- Angular integration with homepage
- Edited Child Theme’s “header.php” but it doesn’t appear to change the file
- Own Theme Customizer displays error message when saving, saving still works
- WordPress redwaves-lite theme Comments Quote remove [closed]
- Page has a parent and $post->post_parent returns 0
- How to create different navigation for registered users in WooThemes Canvas?
- Different logo on homepage
- Translation not working after editing plugin template
- Selected template is not respected for home page in WordPress
- How to restore file or theme?
- A /proc folder in wp-content?
- how do i in ignore/disable/delete a javascript call from parent in child theme?
- How to install themes with the demo content?
- Jetpack CSS .screen-reader-text breaks mobile menu [closed]
- Error when using ‘continue reading’
- How to update theme to specific version
- Child theme’s stylesheet cannot load [closed]
- When someone likes an article on my blog, they are prompted to log in on WordPress.com [closed]
- WordPress TwentyTen Theme Incompatible with Theme Unit Test
- Hi everybody, I have a problem of search box
- WordPress theme logo handling (Trying to use GIF as logo)
- Changing an image in header.php
- Installing a theme on localhost, Ubuntu 16.04
- Unable to find translations in WordPress theme
- Using filter in the widget causes fatal error
- Will I lose the pages I’ve created within a default WordPress theme when adding a new theme?
- Theme title in admin shows full path [closed]
- Multiple sub directories for theme template pages
- How to get the theme directory URI?
- Is there a way to see how a theme will look before buying it?
- My blog suddenly can’t find my stylesheet?
- Twenty Ten Theme: Replace the Logo by a picture without moving the code
- In a specific blog, the K2 theme does not have a Text Widget
- How to fix Scrape key check failed on WordPress VPS?
- How to fix Gutenberg with SiteOrigin page builder deleting content when editing
- Simple filter to change label name of Email Adress to something else
- Show only the beginning of post
- Changing theme folder name disrupts widgets
- Edit a template while still keeping a Landing Page on the main address
- How can I Update my Theme
- Use random theme
- Change whole theme depending on resolution
- post_prev & post_next within same category
- Costum Theme template directoy url problem
- Replacing current theme folder by previous version of the same folder produces “undefined function get_header()” error
- Theme comment callback results nothing
- Does not work bookmarklet in the theme Tagology
- How to find out which template the HTML content comes from?
- What is the general cut-off date for reviewed themes in the WordPress.org repository?
- Sub-Theme (based on Taxonomies)
- Include root files into header files
- Commenting in CSS (//) equals “none”? [closed]
- Adding a wp_head hook from an included PHP file
- What security risk is not having “default” theme?
- Disabling Full Site Editor (FSE)
- get_post_meta() doesn’t allow email