Postscript post test

Data Visionaries and Multi-mediators:
Make any post Sing with Scripts.
Make it Splendid with Styles.
All from within WordPress.
script
WordPress post content box before Postscript
Post content before Postscript
No more shoehorning stylesheets and JavaScripts into the post content box.

No more loading scripts on every post that only a few use.

Postscript lets you easily add libraries or single-post script and style files post-by-post.

WordPress post content box after Postscript
Post content after Postscript
The Postscript plugin tapes into the built-in WordPress “enqueue” methods. This means you can:
mprove site performance:

  • Clean up the post content box.
  • Improve site performance.
  • Control dependencies (when registering scripts).
  • Load styles in the head and scripts in the footer.
  • Eliminate loading multiple copies of the same library (jQuery, I’m looking at you).
style

What it does

Enqueue registered styles and scripts (by handle)

Use the Postscript meta box (Edit Post screen) to enqueue registered of styles and scripts (listed in checkboxes by handle.).

Enqueue unregistered styles, scripts, and data files (by URL)

For each post, you can also enqueue unregistered files, by entering in the meta boxes text fields for:

  • A stylesheet URL.
  • Two JavaScript URLs, e.g, one JSON data file and one script file.
  • Add post and body classes

    And for each post, you can add:

  • Body class(es), to the HTML <body< tag (requires body_class() in theme).
  • Post class(es), to class="post" list (inserted by WordPress, requires post_class() in theme).
  • See the screenshots.

    Credits

    Thanks:This plugin was developed as part of a Reynolds Journalism Institute fellowship.

    Frequently Asked Questions

    Screenshots

  • Edit Post screen Postscript meta box
  • Settings Page: User Roles, Post Types, URls, and Classes
  • Settings Page: Tables of Added Scripts and Styles
  • Settings Page: Remove Scripts and Styles
  • Registration scripts/styles in WordPress

    Your scripts and styles

    You can register your own CSS/JS file handles with the wp_register_script() and the wp_register_style() functions.

    Only handles you register via the wp_enqueue_scripts hook list on Postscript’s Settings screen. This list also has handles registered by your active theme and plugins and the defaults registered by WordPress itself.

    Default scripts and styles

    WordPress registers numerous styles and scripts via its core functions: wp_default_scripts() and wp_default_styles(). Each file gets its own unique handle: see the list of defaults.

    An example: Thickbox

    WordPress ships with a modified ThickBox jQuery library, used to make modal lightbox windows. The add_thickbox() function enables this feature, but it also loads Thickbox’s CSS and JS files on every Post, whether or not the post needs it.

    This plugin improves site performance by only enqueuing scripts only when speficially requested for an individual post, by checking the Thickbox Script and Styles handles in the Postscript box. See the screenshots.

    Contribute

    Postscript is now on GitHub. Pull Requests welcome.

    Text animations from Codrops