WordPress EDUDirect Widget
WordPress plugin to embed the EDUDirect Widget via shortcodes.
Requirements
Installation
If your project does not use Bower yet, initialize it:
$ bower init
Choose a release version, and plug it in:
$ bower install --save [email protected]:CMN/wp-edudirect-widget.git\#~0.0.1
Now symlink the plugin into the WordPress plugins
directory:
$ cd path/to/plugins
$ ln -s ../../../bower_components/wp-edudirect-widget/wp-edudirect-widget
If you'd like to auto-activate this plugin (among others), you can use Eric Clemmons' Auto-Activate WordPress Plugin Script.
Usage
Within posts, use the shortcode directly:
Lorem ipsum dolor sit amet, consectetur adipisicing elit.
[edudirect_widget]
Pariatur, quas, atque commodi voluptatum fugit ...
Or within templates wrap your shortcode:
<?php get_header() ?>
<h3>Quick Degree Finder</h3>
<?php echo do_shortcode('[edudirect_widget]'); ?>
This will:
- Immediately output the HTML template.
- Call
wp_enqueue_script
with the named scriptedudirect_widget
. - Call
add_filter
towp_footer
to append initialization script.
Examples
Default:
[edudirect_widget]
Embedded Custom Template:
[edudirect_widget]<form action="...">...</form>[/edudirect_widget]
Custom Template in the Theme:
[edudirect_widget template="inc/edudirect-widget.php"]
Defaulted Selections:
[edudirect_widget degree=2 category=1 subject=30]