Tag Info

Hot answers tagged

2

functions.php unfortunately is very ingrained part of theme load process. If your architecture is flexible enough you should be able to conditionally unhook related bits. Even if it's not — templates give you complete control over page output. You could go as far as completely omitting wp_head()/wp_footer() calls and handle assets (semi-)manually if that is ...


1

This can easily be done with body classes and conditional statements. Looking at your question, you will have a custom 'page.php' and 'single.php' for what you are doing. For this purpose, I'll call them 'page-custom.php' and 'single-custom.php' We can now assign a body class to these pages with the following function function mytheme_body_classes( ...


1

Inspect the global variable $pagenow, and use post_type_supports() to find post types with an editor: function has_post_editor() { global $pagenow; if ( empty ( $pagenow ) ) return FALSE; if ( ! in_array( $pagenow, array ( 'post-new.php', 'post.php' ) ) ) return FALSE; return post_type_supports( ...


1

I wonder if you are looking for the style_loader_src filter? For example: add_filter( 'style_loader_src', function ( $src ){ // ... your stuff ... return $src; } ); Similarly there exists the script_loader_src filter. There's also the base_url property of the global $wp_scripts and $wp_styles objects, but I think that's only ...



Only top voted, non community-wiki answers of a minimum length are eligible