This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pullquote( $atts, $content = null ) { | |
extract(shortcode_atts(array( | |
'float' => '$align', | |
), $atts)); | |
return '<blockquote class="pullquote ' . $float . '">' . $content . '</blockquote>'; | |
} | |
add_shortcode('pull', 'pullquote') | |
// You can now use the shortcode [pull]your quote here[/pull] in the editor when writing entries. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists( 'threatpost_get_attachment_id_from_src' ) ) { | |
function threatpost_get_attachment_id_from_src( $image_src ) { | |
global $wpdb; | |
$id = $wpdb->get_var( "SELECT ID FROM {$wpdb->posts} WHERE guid='$image_src'" ); | |
return $id; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//display only first 45 characters in the title. | |
$short_title = mb_substr(the_title('','',FALSE),0, 45); | |
echo $short_title; | |
if (strlen( utf8_decode($short_title) ) > 44){ | |
echo '...'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'body_class', 'ms_body_class' ); | |
function ms_body_class( $class ) { | |
global $current_blog; | |
$class[] = 'ms-' . $current_blog-> blog_id; | |
return $class; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* NGData Widget Icons | |
* | |
* @author Lisa Sabin-Wilson | |
* @since 1.0 | |
*/ | |
class icon_text extends WP_Widget |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// swap out the widget-title markup | |
class Badgestack_Sidebar_Markup extends SB_Sidebars { | |
// Activate all sidebars, override this to customize sidebar markup | |
function widgets_init() { | |
// If there aren't any sidebars, skip the rest | |
if ( !$this->sidebars || empty($this->sidebars) ) return; | |
// Otherwise, lets register all of them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// swap out the widget-title markup | |
class Drad_Sidebar_Markup extends SB_Sidebars { | |
// Activate all sidebars, override this to customize sidebar markup | |
function widgets_init() { | |
// If there aren't any sidebars, skip the rest | |
if ( !$this->sidebars || empty($this->sidebars) ) return; | |
// Otherwise, lets register all of them |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Activate all sidebars, override this to customize sidebar markup | |
function widgets_init() { | |
// If there aren't any sidebars, skip the rest | |
if ( !$this->sidebars || empty($this->sidebars) ) return; | |
// Otherwise, lets register all of them | |
foreach ( $this->sidebars as $id => $info ) { | |
register_sidebar(array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function filter_where($where = '') { | |
$where .= " AND post_date < '" . date('Y-m-d') . "'"; | |
return $where; | |
} | |
// Register the filtering function | |
add_filter('posts_where', 'filter_where'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('pre_get_posts', 'query_post_type'); | |
function query_post_type($query) { | |
if(is_category() || is_tag()) { | |
$post_type = get_query_var('post_type'); | |
if($post_type) | |
$post_type = $post_type; | |
else | |
$post_type = array('post','press_piece','knowledge_base_entries', 'nav_menu_item'); | |
$query->set('post_type',$post_type); | |
return $query; |