Note that there are some explanatory texts on larger screens.

plurals
  1. POWP_debug errors with wp_enqueue
    primarykey
    data
    text
    <p>I am getting two types of errors that I don't know how to fix.</p> <p>You can see the errors here: <a href="http://www.brainbuzzmedia.com/themes/vertex/" rel="nofollow">http://www.brainbuzzmedia.com/themes/vertex/</a></p> <p>The first type occurs twice and looks like this:</p> <pre><code>Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks. Please see Debugging in WordPress for more information. (This message was added in version 3.3.) in /home/admin/buzz/themes/vertex/wp-includes/functions.php on line 3587 </code></pre> <p>I have a call in functions.php:</p> <pre><code>function my_init() { if (!is_admin()) { wp_enqueue_script('jquery'); } } add_action('init', 'my_init'); </code></pre> <p>The second error type is this:</p> <pre><code>Notice: Undefined property: stdClass::$slider_height in /vertex/wp-content/themes/vertex/slider_settings.php on line 32 </code></pre> <p>No matter where (inside or outside of if statements or both) I define these variables they are still giving me this error.</p> <p><em>*</em> update</p> <p>I have some other scripts enqueued in a subfolder of the theme's files, mostly used for admin area.</p> <p>$path = get_template_directory_uri() . '/includes/metabox/smart_meta_box/smart_meta_fields/layout-editor/';</p> <p>wp_enqueue_script('mcolorpicker', $path . 'js/mColorPicker.js', array('jquery'));</p> <p>wp_enqueue_style('chosen', $path . 'css/chosen.css');</p> <p>wp_enqueue_style('content-layout', $path . 'css/content-layout.css');</p> <p>wp_enqueue_script('jquery-json', $path . 'js/jquery.json.js', array('jquery'));</p> <p>wp_enqueue_script('chosen-jquery', $path . 'js/chosen.jquery.min.js', array('jquery'));</p> <p>wp_enqueue_script('content-layout-js', $path . 'js/content-layout.js', array('jquery', 'jquery-ui-sortable'));</p> <p>I think they may also be needed for front end display as well. How would I enqueue these the right way?</p> <ul> <li>update 2</li> </ul> <p>Here is the code where two of the undefined property errors occur:</p> <p><a href="http://www.brainbuzzmedia.com/themes/vertex/slider_settings.txt" rel="nofollow">link to txt</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload