HTML Page Element Comments

The THEMECOMMENTS constant is set by the theme according the option in Theme Options -> Skin -> Styles
This will wrap all the main Page Elements in HTML comments indicating start and finish of the element. eg.

<!-- #sidebar -->{Sidebar Output}<!-- /#sidebar -->
This helps make things easier to find when viewing the page source or in a browser debug console. 🙂
Of course it adds unnecessary length to the page size so you will want to turn this off in production.
[Value Filter] skeleton_html_comments - return true/false]

Theme Debug Modes

Theme debug mode sets the THEMEDEBUG constant via the themedebug querystring switch (from any site URL.) You can change switch the debug mode on or off, or set it to temporarily output (for that particular page load.)

In practice, you would usually just use ?themedebug=2 or ?themedebug=yes for a specific pageload. However, to be able to test logged out user content you would need to switch debug mode ON and logout - or simply view the logged out content from another browser with debug ON and then switch it OFF when done. Note: You need edit_theme_options capability to toggle or enable/disable debug mode.

QuerystringAlternativeDebug Action
?themedebug=0?themedebug=offswitch theme debug mode off (persistant)
?themedebug=1?themedebug=onswitch theme debug mode on (persistant)
?themedebug=2?themedebug=yesdebug mode on for this pageload (overrides switch)
?themedebug=3?themedebug=nodebug mode off for this pageload (overrides switch)
[Value Filter]skeleton_theme_debugreturn true/false

When active you debug information will be output to the HTML page source wrapped in HTML comment tags.
Each debug info occurrence will appear in the form of:
<!-- Debug Info Description: {INFO} -->
This is so you can search the theme source for a particular 'Info Description' to see what is happening.

Warning: this kind of debug output can prevent Theme Settings or other admin/form/AJAX methods from saving! This is because echoing this information inline means headers are already sent and thus can prevent redirects - causing the Settings API and other things to fail. :-/ So always remember to turn theme debug mode off!

Included Page Templates

You can easily see what page templates are being included on a page (useful for WooCommerce/Forum templates etc.) Simply search for 'Included Template Files' (Debug Info Description) in the page source when debug mode is active. You will find a list of all files included between the wp_loaded and wp_footer action hooks in the page footer.

Leave a Reply

Your email address will not be published. Required fields are marked *