Blank admin dashboard. Am I using wp_enqueue correctly on my child theme?
-
Hello,
I have never had this problem before until I forced myself to use wp_enqueue_scripts. I think it’s a really cool way of doing things, by the way. I’m a web designer and beginner at java programming.
My issue is just what the title says: Blank pages on my whole website, including the Dashboard. When the site does work, I see the blank page again whenever updating pages, configuring plugins, etc. It always crashes when “&_wpnonce=” is affixed the the end of my url.
When the parent theme is active, my Dashboard and all functions work fine, except my WP Admin bar is not showing on the front end. One problem at a time though.
My question is; What is the best way to arrange the wp_enqueue function to add specific scripts & stylesheets to specific pages?
I will share what my functions.php looks like in another comment, but for right now, can you tell me if this a good way to approach what I want to do?
<?php if (!is_admin()) { add_action( 'wp_enqueue_scripts', 'miosa_theme_scripts' ); function miosa_theme_scripts() { if ( is_page_template('page-slider.php') ) { wp_register_script('...'); wp_register_script('...'); wp_register_script('...'); wp_enqueue_script('modernizr'); wp_enqueue_script('slider-jquery'); wp_enqueue_script('slider-config'); } elseif ( is_page_template('page-photo.php') ) { wp_register_script('...') ); wp_register_script('...') ); wp_enqueue_script('isotope-jquery'); wp_enqueue_script('isotope-config'); } } }
That is a generalized version for my javascript. There is another one for my stylesheets and they all have a unique
$handle
I am using the (!is_admin) condition because I thought these scripts were causing my WP Dashboard to be blank. It could be something else? I have no idea. But between this and my browser cache and server cache, this website development is taking a lot longer than I wanted it to. I would really appreciate to hear other peoples’ advise because this is the first time I’m using the wp_enqueue_scripts constructor.
Thanks,
Rick
- The topic ‘Blank admin dashboard. Am I using wp_enqueue correctly on my child theme?’ is closed to new replies.