Using Primary Color in Plugin Block
Using Primary Color in Plugin Block
Using Primary Color in Plugin Block
If space were the only problem you could simply enqueue a css file to the admin area with these lines to expand the width of the customizer panel from the usual 300px to 500px: .wp-full-overlay-sidebar {width 500px !important;} .wp-full-overlay.expanded {margin-left:500px !important;} Hey, you could even enqueue a js file to insert a button to toggle … Read more
I’m no expert but I don’t know of any php way to do it … This is a long shot which you’d need to try out, but could you use css or jquery to target the first child or nth child of #availablethemes in the admin css and set it to display:none. I don’t know … Read more
A more compact and WordPress-ish way, using url_to_postid(): function wpmp_switcher_exclusions_init() { $pid = url_to_postid( home_url( add_query_arg( array() ) ) ); if ( (int) $pid > 0 && get_post_meta( $pid, ‘_wp_page_template’, TRUE ) === ‘my-responsive-template.php’ ) { remove_action(‘init’, ‘wpmp_switcher_init’); remove_action(‘admin_menu’, ‘wpmp_switcher_admin_menu’); remove_action(‘wp_footer’, ‘wpmp_switcher_wp_footer’); remove_filter(‘stylesheet’, ‘wpmp_switcher_stylesheet’); remove_filter(‘template’, ‘wpmp_switcher_template’); remove_filter(‘option_home’, ‘wpmp_switcher_option_home_siteurl’); remove_filter(‘option_siteurl’, ‘wpmp_switcher_option_home_siteurl’); } } add_action( ‘setup_theme’, ‘wpmp_switcher_exclusions_init’ … Read more
Try hooking on all these: (But I guess you’d have to do it from a plugin, since doing it from theme functions.php might be too late). E.g.: /* Plugin Name: test Description: switchtest Version: 0.1.0 */ add_filter( ‘template’, ‘yourthing_switch_theme’ ); add_filter( ‘option_template’, ‘yourthing_switch_theme’ ); add_filter( ‘option_stylesheet’, ‘yourthing_switch_theme’ ); add_filter( ‘pre_option_stylesheet’, ‘yourthing_switch_theme’ ); function yourthing_switch_theme( $theme … Read more
You can use PHP’s output buffering. WIth this you can write a wrapper for the get_head() function function wpse251841_wp_head() { ob_start(); wp_head(); return ob_get_clean(); } You can then use this as $data = array( ‘wpHead’ => wpse251841_wp_head(), ‘postContent’ => $post->post_content, ‘postContentFiltered’ => apply_filters( ‘the_content’, $post->post_content ) ); Reference: Output Control Functions
That part is extremely rigid, see this question about loading page templates from plugin directory. With current state of related code I would not bother spending time on this. Especially since you want it for convenience (putting template in sub-directories) and not functionality (like loading from plugin folder).
Not a full answer, but I can at least answer this question: Also custom post template files can not be in sub directories. Everything, that you can load via get_template_part(), can reside in a subfolder: get_template_part( ‘subdir/part’, ‘suffix’ ); It’s as easy as that. Now you’ve your part inside ~/wp-content/themes/theme_folder/subdir/part-suffix.php Slightly off topic. Then there’re … Read more
Building admin interfaces in WordPress is quite ad hoc. Which is historical reason for many of those interface looking nothing like WP admin surrounding them. In general it works in terms of markup, rather than colors. You don’t code in terms of “black” or “red”, but in semantic terms like “primary” or “notification”. There are … Read more
How often are the theme mods changed? A lot in the design phase, maybe a couple of times later on. Always by admins, never by ordinary users, let alone visitors. So, it doesn’t make sense to generate the full css at every pageload (additional background info). A better approach is to generate the css only … Read more