10

WordPress Tip: Conditional Loading Scripts Based On Post Content

http://www.deluxeblogtips.com

Sometimes you want to load one script in only specified posts, not for all posts. For example: you want load Thinkbox script only when post has images, load SyntaxHighlighter only when post has codes. It wouldn't be optimized if you always load these scripts in every posts. We just want WordPress to load them when we need based on post content.

Created by rilwis 1 year 41 weeks ago – Made popular 1 year 41 weeks ago
Category: Wordpress Hacks