[theme-reviewers] Printing JavaScript in footer

Edward Caissie edward.caissie at gmail.com
Sat Aug 3 16:03:50 UTC 2013


That script can, and more importantly *should* be enqueued.

Edward Caissie
aka Cais.


On Sat, Aug 3, 2013 at 11:54 AM, Harish <me at harishchouhan.com> wrote:

> Hi,****
>
> ** **
>
> I have seen many premium themes doing this. Not a good practise so I would
> not recommend it. ****
>
> ** **
>
> ** **
>
> ** **
>
> Regards,****
>
> Harish Chouhan****
>
> ** **
>
> *Visit me at *- www.harishchouhan.com
> Phone: +91-9833661410 | Email: me at harishchouhan.com **
>
> ** **
>
> *From:* theme-reviewers [mailto:
> theme-reviewers-bounces at lists.wordpress.org] *On Behalf Of *Ola Laczek
> *Sent:* Sat 03 August 13 09:16 PM
> *To:* theme-reviewers at lists.wordpress.org
> *Subject:* [theme-reviewers] Printing JavaScript in footer****
>
> ** **
>
> Hello!****
>
> ** **
>
> I'm reviewing a theme that prints javascript in the footer from
> functions.php like this:****
>
> ** **
>
> add_action('wp_footer', 'flex_init');****
>
> function flex_init() {****
>
>      echo '<script type="text/javascript">****
>
>     jQuery(document).ready(function() {****
>
>         jQuery("#slider").flexslider();****
>
>      });****
>
>      </script>';****
>
> }****
>
> ** **
>
> Is this ok, or should I tell this person to create separate javascript
> file, put this code there and enqueue like other scripts?****
>
> ** **
>
> ** **
>
> Best regards,
> Ola Łączek****
>
> ** **
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20130803/e172875e/attachment.html>


More information about the theme-reviewers mailing list