__('Primary Navigation', 'roots'),
));
// Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails)
add_theme_support('post-thumbnails');
// Add post formats (http://codex.wordpress.org/Post_Formats)
add_theme_support('post-formats', array('gallery', 'link', 'image', 'quote', 'video', 'audio'));
// Tell the TinyMCE editor to use a custom stylesheet
add_editor_style('assets/css/editor-style.css');
}
add_action('after_setup_theme', 'roots_setup');
add_action( 'admin_notices', 'is_options_css_writable' );
function is_options_css_writable(){
if( !is_writable( locate_template('/css/options.css') ) )
echo '
css/options.css rights is not enough
';
}
add_filter( 'the_category', 'add_nofollow_cat' );
function add_nofollow_cat( $text ) {
$text = str_replace('rel="category tag"', "", $text); return $text;
}
add_filter('widget_text', 'do_shortcode');
function limit_words($string, $word_limit) {
// creates an array of words from $string (this will be our excerpt)
// explode divides the excerpt up by using a space character
$words = explode(' ', $string);
// this next bit chops the $words array and sticks it back together
// starting at the first word '0' and ending at the $word_limit
// the $word_limit which is passed in the function will be the number
// of words we want to use
// implode glues the chopped up array back together using a space character
return implode(' ', array_slice($words, 0, $word_limit));
}
add_filter( 'wp_get_attachment_image', 'remove_thumbnail_dimensions', 10 );
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 );
function remove_thumbnail_dimensions( $html ) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
// show admin bar only for admins
if (!current_user_can('manage_options')) {
add_filter('show_admin_bar', '__return_false');
}
// show admin bar only for admins and editors
if (!current_user_can('edit_posts')) {
add_filter('show_admin_bar', '__return_false');
}
function template_admin_head(){
echo '';
echo '';
}
add_action('admin_head', 'template_admin_head');
function dfi_per_catgory($dfi) {
if ( has_category('10-things') ) {
return 17158; /*media id*/
} else if( has_category('culinary') ) {
return 17155; /*media id*/
} else if( has_category('foh') ) {
return 17149; /*media id*/
} else if( has_category('holiday-posts') ) {
return 17159; /*media id*/
} else if( has_category('hotel-notes') ) {
return 17157; /*media id*/
} else if( has_category('travel-tuesday') ) {
return 17147; /*media id*/
} else if( has_category('how-we-see-it') ) {
return 17107; /*media id*/
} else if( has_category('coach') ) {
return 16137; /*media id*/
} else if( has_category('consult') ) {
return 17160; /*media id*/
} else if( has_category('podcasts') ) {
return 17148; /*media id*/
} else if( has_category('pub-speak-facilitate') ) {
return 16785; /*media id*/
} else if( has_category('qfo') ) {
return 16789; /*media id*/
} else if( has_category('they-just-dont-get-it') ) {
return 17153; /*media id*/
} else if( has_category('marketing-branding') ) {
return 17151; /*media id*/
} else if( has_category('groupon') ) {
return 17146; /*media id*/
} else if( has_category('guest-experience') ) {
return 17143; /*media id*/
} else if( has_category('social-business') ) {
return 17142; /*media id*/
} else if( has_category('surveys-research') ) {
return 17145; /*media id*/
} else if( has_category('yelp') ) {
return 17144; /*media id*/
} else if( has_category('people-culture-hwsi') ) {
return 16759; /*media id*/
} else if( has_category('tlntmgmt') ) {
return 17150; /*media id*/
} else if( has_category('train') ) {
return 16742; /*media id*/
} else if( has_category('restaurant-notes') ) {
return 17161; /*media id*/
} else if( has_category('business-2') ) {
return 16782; /*media id*/
} else if( has_category('nso') ) {
return 17064; /*media id*/
} else if( has_category('the-law') ) {
return 17156; /*media id*/
} else if( has_category('govt-regs') ) {
return 17156; /*media id*/
} else if( has_category('leadership-theory') ) {
return 17154; /*media id*/
} else if( has_category('cost-controls-hwsi') ) {
return 16476; /*media id*/
} else if( has_category('technology-2') ) {
return 17162; /*media id*/
}
return $dfi; // return the default $dfi
}
add_filter( 'dfi_thumbnail_id', 'dfi_per_catgory');