';
echo '';
echo '';
}
/* Register Sidebars
/* ----------------------------------------------*/
if ( function_exists('register_sidebar') ) {
register_sidebar(array(
'name' => 'Homepage Sidebar',
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
));
register_sidebar(array(
'name' => 'Inside Sidebar',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
));
}
/* Register Menus
/* ----------------------------------------------*/
if ( function_exists( 'register_nav_menus' ) ) {
add_theme_support( 'menus' );
add_action( 'init', 'ds_register_menu' );
function ds_register_menu() {
register_nav_menus(
array(
'header-menu' => "Header Menu",
'footer-menu' => "Footer Menu",
)
);
}
}
/* Comments
/* ----------------------------------------------*/
function realestatetheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
id="li-comment-">
Del ';
echo '• ';
}
}
/* Custom Excerpt/Title
/* ----------------------------------------------*/
function custom_excerpt($temp_content='', $temp_max=800, $cont_reading = true) {
global $post;
$temp_content = get_the_content('', false, '');
$testlen = strlen($temp_content);
if ( $testlen > $temp_max ) :
$maxchars = $temp_max;
$temp_content = strip_shortcodes( $temp_content );
$temp_content = strip_tags($temp_content);
$temp_content = substr($temp_content, 0, $maxchars);
$pos = strrpos($temp_content, '');
if ( $pos > 0) :
$temp_content = substr($temp_content, 0, $pos);
endif;
if ($cont_reading) :
$temp_content = apply_filters('the_content', $temp_content . '... ' . ' Continue Reading ' . $post->post_title . '');
else :
$temp_content = apply_filters('the_content', $temp_content . '... ');
endif;
echo $temp_content;
else :
if ($cont_reading) :
$temp_content = apply_filters('the_content', $temp_content . ' Continue Reading ' . $post->post_title . '');
endif;
echo apply_filters('the_content', $temp_content);
endif;
}
/* Style Switcher
/* ----------------------------------------------*/
function the_new_stylesheet( $stylesheet_uri, $stylesheet_dir_uri ) {
if ( ! of_get_option('css_skin') ) {
$stylesheet_uri = $stylesheet_dir_uri . '/style.css';
} else {
$stylesheet_uri = $stylesheet_dir_uri . '/' . of_get_option('css_skin');
}
return $stylesheet_uri;
}
add_filter( 'stylesheet_uri', 'the_new_stylesheet', 10, 2);
function ts_exclude_gallery() {
$excludeThis = new WP_Query();
$excludeThis->query(
array(
'showposts' => -1,
'ignore_sticky_posts' => 1,
'tax_query' => array(
'relation' => 'OR',
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array( 'gallery' )
),
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-gallery' )
)
)
)
);
$gallery_list_ids = array();
while ($excludeThis->have_posts()) : $excludeThis->the_post();
$gallery_list_ids[] = get_the_ID();
endwhile;
return $gallery_list_ids;
}
?>