<font color="#333333"><font size="2"><font face="arial,helvetica,sans-serif">something I didn't know, all right thank you sir, will make a note of that :)<br clear="all"></font></font></font><div><strong><font face="arial, helvetica, sans-serif">----</font></strong></div>
<div><font face="arial, helvetica, sans-serif"><strong>Emil Uzelac</strong> | ThemeID | T: 224-444-0006 | Twitter: @EmilUzelac | E: <a href="mailto:emil@themeid.com" target="_blank">emil@themeid.com</a> | <a href="http://themeid.com/" target="_blank">http://themeid.com</a></font></div>
<div><font color="#999999" face="arial, helvetica, sans-serif">Make everything as simple as possible, but not simpler. - Albert Einstein</font></div><br>
<br><br><div class="gmail_quote">On Mon, Apr 25, 2011 at 1:42 AM, Otto <span dir="ltr"><<a href="mailto:otto@ottodestruct.com">otto@ottodestruct.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Actually, wp_enqueue_scripts is a better action hook to use.<br>
wp_print_scripts also happens in the admin area, not just on the front<br>
end. If you do want things in the admin area, then hook it to<br>
admin_enqueue_scripts as well.<br>
<br>
Also, enqueuing jQuery first is not necessary. If the other scripts<br>
require it, then it gets automatically enqueued. That's the point of<br>
the dependency system and the third parameter to wp_enqueue_script().<br>
<font color="#888888"><br>
-Otto<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
On Sun, Apr 24, 2011 at 8:09 PM, Emil Uzelac <<a href="mailto:emil@themeid.com">emil@themeid.com</a>> wrote:<br>
> Also, this is what I have in my functions.php for future references: (all<br>
> added in footer area as well)<br>
> /**<br>
> * A safe way of adding javascripts to a WordPress generated page.<br>
> */<br>
> if (!is_admin())<br>
> add_action('wp_print_scripts', 'fit_js');<br>
> if (!function_exists('fit_js')) {<br>
> function fit_js() {<br>
> wp_enqueue_script('jquery');<br>
> wp_enqueue_script('modernizr', get_template_directory_uri() .<br>
> '/js/modernizr-min.js', array('jquery'), '1.7.0', true);<br>
> wp_enqueue_script('scripts', get_template_directory_uri() .<br>
> '/js/scripts.js', array('jquery'), '1.0.4', true);<br>
> wp_enqueue_script('functions', get_template_directory_uri() .<br>
> '/js/functions.js', array('jquery'), '1.0.4', true);<br>
> }<br>
> }<br>
> ----<br>
> Emil Uzelac | ThemeID | T: 224-444-0006 | Twitter: @EmilUzelac | E:<br>
> <a href="mailto:emil@themeid.com">emil@themeid.com</a> | <a href="http://themeid.com" target="_blank">http://themeid.com</a><br>
> Make everything as simple as possible, but not simpler. - Albert Einstein<br>
><br>
><br>
> On Sun, Apr 24, 2011 at 8:05 PM, Curtis McHale <<a href="mailto:curtis@curtismchale.ca">curtis@curtismchale.ca</a>><br>
> wrote:<br>
>><br>
>> Alright I'll leave it to you.<br>
>><br>
>> Curtis McHale<br>
>> PH: 604.751.3482<br>
>> <a href="http://www.curtismchale.ca" target="_blank">http://www.curtismchale.ca</a><br>
>> Linkedin: <a href="http://www.linkedin.com/in/curtismchale" target="_blank">http://www.linkedin.com/in/curtismchale</a><br>
>> Twitter: <a href="http://twitter.com/curtismchale" target="_blank">twitter.com/curtismchale</a><br>
>><br>
>><br>
>><br>
>> On Sun, Apr 24, 2011 at 5:48 PM, Chip Bennett <<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>><br>
>> wrote:<br>
>>><br>
>>> I've got a few related Guidelines that were discussed on the Make site,<br>
>>> that I need to add. I'll take a look at it tomorrow. :)<br>
>>> Chip<br>
>>><br>
>>> On Sun, Apr 24, 2011 at 7:41 PM, Curtis McHale <<a href="mailto:curtis@curtismchale.ca">curtis@curtismchale.ca</a>><br>
>>> wrote:<br>
>>>><br>
>>>> Where would you suggest that specific mention of this is made in the<br>
>>>> theme review guidelines? I'm happy to add it. As I read it alongside the<br>
>>>> information on internationalization since if you include new JS you must use<br>
>>>> the proper enqueue.<br>
>>>><br>
>>>> Curtis McHale<br>
>>>> PH: 604.751.3482<br>
>>>> <a href="http://www.curtismchale.ca" target="_blank">http://www.curtismchale.ca</a><br>
>>>> Linkedin: <a href="http://www.linkedin.com/in/curtismchale" target="_blank">http://www.linkedin.com/in/curtismchale</a><br>
>>>> Twitter: <a href="http://twitter.com/curtismchale" target="_blank">twitter.com/curtismchale</a><br>
>>>><br>
>>>><br>
>>>><br>
>>>> On Sun, Apr 24, 2011 at 5:38 PM, Chip Bennett <<a href="mailto:chip@chipbennett.net">chip@chipbennett.net</a>><br>
>>>> wrote:<br>
>>>>><br>
>>>>> Yes, require that script to be enqueued properly.<br>
>>>>> Chip<br>
>>>>><br>
>>>>> On Sun, Apr 24, 2011 at 7:32 PM, Curtis McHale <<a href="mailto:curtis@curtismchale.ca">curtis@curtismchale.ca</a>><br>
>>>>> wrote:<br>
>>>>>><br>
>>>>>> Are themes required to enqueue javascript with the built in WordPress<br>
>>>>>> functions? I assume so but don't find specific reference to it in the theme<br>
>>>>>> reviewer docs. The theme I'm currently reviewing includes jQuery from Google<br>
>>>>>> CDN in the footer inside script tags.<br>
>>>>>><br>
>>>>>> Curtis McHale<br>
>>>>>> PH: 604.751.3482<br>
>>>>>> <a href="http://www.curtismchale.ca" target="_blank">http://www.curtismchale.ca</a><br>
>>>>>> Linkedin: <a href="http://www.linkedin.com/in/curtismchale" target="_blank">http://www.linkedin.com/in/curtismchale</a><br>
>>>>>> Twitter: <a href="http://twitter.com/curtismchale" target="_blank">twitter.com/curtismchale</a><br>
>>>>>><br>
>>>>>><br>
>>>>>> _______________________________________________<br>
>>>>>> theme-reviewers mailing list<br>
>>>>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>>>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>>>>><br>
>>>>><br>
>>>>><br>
>>>>> _______________________________________________<br>
>>>>> theme-reviewers mailing list<br>
>>>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>>>><br>
>>>><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> theme-reviewers mailing list<br>
>>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>>><br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> theme-reviewers mailing list<br>
>>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> theme-reviewers mailing list<br>
>> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
>> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
>><br>
><br>
><br>
> _______________________________________________<br>
> theme-reviewers mailing list<br>
> <a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
> <a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
><br>
><br>
_______________________________________________<br>
theme-reviewers mailing list<br>
<a href="mailto:theme-reviewers@lists.wordpress.org">theme-reviewers@lists.wordpress.org</a><br>
<a href="http://lists.wordpress.org/mailman/listinfo/theme-reviewers" target="_blank">http://lists.wordpress.org/mailman/listinfo/theme-reviewers</a><br>
</div></div></blockquote></div><br>