Skip to content

Instantly share code, notes, and snippets.

View bhwebworks's full-sized avatar

John Sundberg bhwebworks

View GitHub Profile
@bhwebworks
bhwebworks / gist:1696392
Created January 29, 2012 00:20
VideoPress embed shortcode with width
[wpvideo U0t5LnWv w=633]
@bhwebworks
bhwebworks / gist:1696398
Created January 29, 2012 00:23
VideoPress embed code
<embed type="application/x-shockwave-flash"
src="http://s0.videopress.com/player.swf?v=1.03" width="400"
height="300" wmode="direct" seamlesstabbing="true"
allowfullscreen="true" allowscriptaccess="always" overstretch="true"
flashvars="guid=U0t5LnWv&amp;isDynamicSeeking=true">
</embed>
@bhwebworks
bhwebworks / gist:1696410
Last active September 30, 2015 00:58
VideoPress embed code trimmed down and used as image link
<div style="text-align: center;">
<a href="http://s0.videopress.com/player.swf?guid=U0t5LnWv&amp;v=1.03"
data-lightbox="width:640;height:480">
<img title="Seasons screenshot" src="http://blackhillswebworks.com/wp-content/uploads/2012/01/seasons-screenshot.jpg"
alt="Seasons screenshot" width="400" height="286" />
</a>
</div>
@bhwebworks
bhwebworks / gist:1696423
Last active September 30, 2015 00:58
VideoPress shortcode combined with the Widgetkit Lightbox
<div style="text-align: center;">
<a title="Seasons" href="#U0t5LnWv" data-lightbox="">
<img title="Seasons" src="http://blackhillswebworks.com/wp-content/uploads/2012/01/seasons-screenshot.jpg"
alt="Seasons screenshot" width="400" height="286" />
</a>
</div>
<div style="display: none;">
<div id="U0t5LnWv" style="width: 633px; height: 475px; overflow: hidden;">
[wpvideo U0t5LnWv w=633 h=475]
@bhwebworks
bhwebworks / gist:1696466
Created January 29, 2012 00:44
Add 'category' to the widget's function
'scope' => 'future',
'category' => 0, // this adds 'category' to the widget's function
'order' => 'ASC',
@bhwebworks
bhwebworks / gist:1696474
Created January 29, 2012 00:47
Add the category option to the widget's form
<p>
<label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title'); ?>: </label>
<input type="text" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" value="<?php echo $instance['title']; ?>" />
</p>
<p><!-- this adds the category option to the widget's form -->
<label for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Category ID','dbem'); ?>: </label>
<input type="text" id="<?php echo $this->get_field_id('category'); ?>" name="<?php echo $this->get_field_name('category'); ?>" size="3" value="<?php echo $instance['category']; ?>" /><br />
<label for="<?php echo $this->get_field_id('category'); ?>"><?php _e('(separate multiple IDs by commas, or use "0" for all categories)','dbem'); ?> </label>
</p>
<p>
@bhwebworks
bhwebworks / gist:1696481
Created January 29, 2012 00:50
Add to events-manager.php
include_once("widgets/em-events-by-category.php");
@bhwebworks
bhwebworks / gist:1696490
Created January 29, 2012 00:52
Code for the modified em-events-manager.php file. Changes in lines 4,7,12,14,16,25-26,81-85,165
<?php
/**
* @author marcus
* modified by John Sundberg
* Standard events list widget
*/
class EM_Widget_by_category extends WP_Widget {//changed
var $defaults;
@bhwebworks
bhwebworks / gist:1696789
Created January 29, 2012 02:14
Limit the number of post revisions
/** Added the following to limit the number of post revisions */
define('WP_POST_REVISIONS', 3);
@bhwebworks
bhwebworks / gist:1696799
Created January 29, 2012 02:16
Delete existing post revisions from your database
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_type = 'revision'