Category Archives: WordPress

How to pull videos from Media Library in JWPlayer video playlist?

Screen shot 2013-10-28 at 9.40.42 AM

@NYC office 333

wp_salt

Salt in some religious ritual is to avoid demons to attack. In Supernatural, Sam and Deen use salt a lot to avoid demons invasion. Which is understandable. A-ha! Today I read the definition of wp_salt from WordPress Codex: “Get salt to add to hashes to help prevent attacks.” This definition really cracked me up. I asked my coworker who is also a fan of Supernatural to read it. He cracked up too. A-ha!

Anyway, it was a fun studying day of building WordPress plugins and widgets.

NYC @home 145

Slidedeck Pro – How to display 1 slide instead of 3 slides (default)

Open add-edit-dynamic.php under views folder.
On line 122, change 3 to 1.

<select name=”dynamic_options[total]” id=”slidedeck_total_slides”>
<?php for( $i = 1; $i <= 10; $i++ ): ?>
<option value=”<?php echo $i; ?>”<?php echo $slidedeck[‘dynamic_options’][‘total’] == $i ? ‘ selected=”selected”‘ : ”; ?>><?php echo $i; ?></option>
<?php endfor; ?>
</select>

Go to Edit Smart SlideDeck on WordPress dashboard and change 3 to 1.

Done

NYC @333 office

loop-archive.php – Different size post thumbnails in different categories

The original post thumbnail size for categories is 150px x 150px. It’s not not a good fit for DT thumbnail size of Current Issue category.  The dimension thumbnail size for Current Issue category should be 150px x 204px.  Below is the if condition code I figured it out by myself. Hooray!

@333 office, NYC
Screen shot 2012-12-14 at 4.34.04 PM<?php

if (is_category(’29’)) {
colabs_post_meta();

$width = get_option ( “colabs_thumbWidth_Archive” );
//$height = get_option ( “colabs_thumbHeight_Archive” );
if ( $width == 0 ) { $width = 150; }
if ( $height == 0 ) { $height = 204; }
colabs_pp(‘width=’.$width.’&height=’.$height.’&size=small-thumb&play=true&wrapper_class=left&link=img’);

the_excerpt();
} else {
colabs_post_meta();

$width = get_option ( “colabs_thumbWidth_Archive” );
$height = get_option ( “colabs_thumbHeight_Archive” );
if ( $width == 0 ) { $width = 80; }
if ( $height == 0 ) { $height = 80; }
colabs_pp(‘width=’.$width.’&height=’.$height.’&size=small-thumb&play=true&wrapper_class=left&link=img’);

the_excerpt();

}
?>

function.php – Disable Fancybox on certain page

// Disable Fancybox plugin for cheerleader-of-the-year Page
function disable_fancybox() {
if (is_page(‘cheerleader-of-the-year’)) {
remove_action(‘wp_print_scripts’, ‘mfbfw_load’);
remove_action(‘wp_print_styles’, ‘mfbfw_css’);
remove_action(‘wp_head’, ‘mfbfw_init’);

}
}
add_action(‘wp_head’, ‘disable_fancybox’, 1);

@333 office