__( 'Primary Navigation', 'designtidbits' ),
) );
}
endif;
function designtidbits_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'designtidbits_page_menu_args' );
function designtidbits_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'designtidbits_excerpt_length' );
function designtidbits_continue_reading_link() {
return ' ';
}
function designtidbits_auto_excerpt_more( $more ) {
return ' …' . designtidbits_continue_reading_link();
}
add_filter( 'excerpt_more', 'designtidbits_auto_excerpt_more' );
function designtidbits_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= designtidbits_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'designtidbits_custom_excerpt_more' );
add_filter( 'use_default_gallery_style', '__return_false' );
function designtidbits_remove_gallery_css( $css ) {
return preg_replace( "##s", '', $css );
}
if ( version_compare( $GLOBALS['wp_version'], '3.1', '<' ) )
add_filter( 'gallery_style', 'designtidbits_remove_gallery_css' );
if ( ! function_exists( 'designtidbits_comment' ) ) :
function designtidbits_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case '' :
?>
id="li-comment-">
__( 'Primary Widget Area', 'designtidbits' ),
'id' => 'primary-widget-area',
'description' => __( 'The primary widget area', 'designtidbits' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
// Area 2, located below the Primary Widget Area in the sidebar. Empty by default.
register_sidebar( array(
'name' => __( 'Secondary Widget Area', 'designtidbits' ),
'id' => 'secondary-widget-area',
'description' => __( 'The secondary widget area', 'designtidbits' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'designtidbits_widgets_init' );
function designtidbits_remove_recent_comments_style() {
add_filter( 'show_recent_comments_widget_style', '__return_false' );
}
add_action( 'widgets_init', 'designtidbits_remove_recent_comments_style' );
if ( ! function_exists( 'designtidbits_posted_on' ) ) :
function designtidbits_posted_on() {
printf( __( 'Posted on %2$s by %3$s', 'designtidbits' ),
'meta-prep meta-prep-author',
sprintf( '%3$s',
get_permalink(),
esc_attr( get_the_time() ),
get_the_date()
),
sprintf( '%3$s',
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'View all posts by %s', 'designtidbits' ), get_the_author() ),
get_the_author()
)
);
}
endif;
if ( ! function_exists( 'designtidbits_posted_in' ) ) :
function designtidbits_posted_in() {
$tag_list = get_the_tag_list( '', ', ' );
if ( $tag_list ) {
$posted_in = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the permalink.', 'designtidbits' );
} elseif ( is_object_in_taxonomy( get_post_type(), 'category' ) ) {
$posted_in = __( 'This entry was posted in %1$s. Bookmark the permalink.', 'designtidbits' );
} else {
$posted_in = __( 'Bookmark the permalink.', 'designtidbits' );
}
printf(
$posted_in,
get_the_category_list( ', ' ),
$tag_list,
get_permalink(),
the_title_attribute( 'echo=0' )
);
}
endif;
/*
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Plugin Name: Gravatar
Plugin URI: http://www.gravatar.com/implement.php#section_2_2
*/
function gravatar($rating = false, $size = false, $default = false, $border = false) {
global $comment;
$out = "http://www.gravatar.com/avatar.php?gravatar_id=".md5($comment->comment_author_email);
if($rating && $rating != '')
$out .= "&rating=".$rating;
if($size && $size != '')
$out .="&size=".$size;
if($default && $default != '')
$out .= "&default=".urlencode($default);
if($border && $border != '')
$out .= "&border=".$border;
echo $out;
}
/*
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Plugin Name: Post Images
*/
function get_post_images($size = 'thumbnail',$post_id='') { //thumbnail, medium, large or full
global $wp_query, $wpdb, $post;
if($post_id=='')
$post_id = $post->ID;
$querystr = "
SELECT p.*
FROM $wpdb->posts p
WHERE (p.post_mime_type='image/gif'
or p.post_mime_type='image/png'
or p.post_mime_type='image/jpeg'
) and p.post_type='attachment' and post_parent = '$post_id'
ORDER BY p.menu_order limit 1
";
$photo = $wpdb->get_results($querystr, OBJECT);
if ($photo) {
$att = wp_get_attachment_image_src($photo[0]->ID, $size);
//$alt = get_post_meta($photo[0]->ID, '_wp_attachment_image_alt', true);
//$att[0]['title'] = $photo[0]->post_title;;
return $att[0];
}
return false;
}
function content($limit) {
$content = explode(' ', get_the_content(), $limit);
if (count($content)>=$limit) {
array_pop($content);
$content = implode(" ",$content).'...';
} else {
$content = implode(" ",$content);
}
$content = apply_filters('the_content', $content);
return $content;
}
function improved_trim_excerpt($text) {
global $post;
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace('\]\]\>', ']]>', $text);
$text = preg_replace('@@si', '', $text);
$text = strip_tags($text, ''.''.''.''.''.''.''.''.'');
$excerpt_length = 55;
$words = explode(' ', $text, $excerpt_length + 1);
if (count($words)> $excerpt_length) {
array_pop($words);
array_push($words, '[...]');
$text = implode(' ', $words);
}
}
return $text;
}
remove_filter('the_excerpt', 'wp_trim_excerpt');
add_filter('the_excerpt', 'improved_trim_excerpt');
/*
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Plugin Name: DDThemes - Logo Options
Plugin URI: http://www.designdisease.com/
*/
//ADD OPTION PAGE
add_action('admin_menu', 'rtlogoop_admin');
//UPON ACTIVATION OR PREVIEWED
if ( $_GET['activated'] == 'true' || $_GET['preview'] == 1 )
{
rtlogoop_setup();
}
function rtlogoop_admin()
{
/* PROCESS OPTION SAVING HERE */
if ( 'save' == $_REQUEST['action'] )
{
if ( $_REQUEST['savetype'] == 'header' )
{
update_option( 'rtlogoop_header', $_REQUEST['rtlogoop_header']);
}
}
/* SHOW THEME CUSTOMIZE PAGE HERE */
add_theme_page(__('Logo Options'), __('Logo Options'), 'edit_themes', basename(__FILE__), 'rtlogoop_headeropt_page');
}
function rtlogoop_headeropt_page()
{ ?>
';
?>