Forbidden';
exit();
}
/*******************************************************************************
* Theme Support Options to be initialized
*/
add_editor_style();
add_theme_support( 'custom-background');
add_theme_support( 'automatic-feed-links' );
add_filter('show_admin_bar', '__return_false');
/*******************************************************************************
* Content Width to be initialized if not already set
*/
if ( ! isset( $content_width ) )
$content_width = 600;
/*******************************************************************************
* Register widgetized sidebars and nav_menu
*/
if (function_exists('register_sidebar')) {
// Register sidebar
register_sidebar(array(
'name' => "sidebar",
'description' => __('Bootstrap Widgetized', 'bootstrap'),
'before_widget' => '
',
'before_title' => '
',
'after_title' => '
',
'after_widget' => '
'));
// Register Nav Menu
register_nav_menu( 'primary', 'Bootstrap nav menu' );
}
/*******************************************************************************
* Function called from header.php to load all theme scripts and styles
*/
function boot_load_theme_styles_scripts () {
// Enqueue bootstrap js scripts
wp_enqueue_script('bootstrap-js', get_template_directory_uri() . '/assets/bootstrap/js/bootstrap.min.js', array( 'jquery' ) );
// Enqueue bootstrap css styles
wp_enqueue_style('bootstrap-min-css', get_template_directory_uri() . '/assets/bootstrap/css/bootstrap.min.css', array() );
wp_enqueue_style('bootstrap-glyphions-css', get_template_directory_uri() . '/assets/bootstrap/css/bootstrap-glyphicons.css', array() );
wp_enqueue_style('custom-style-css', get_template_directory_uri() . '/assets/css/customStyle.css', array() );
}
/*******************************************************************************
* Filter to lower the context to a summary length for archive templates only
*/
add_filter('the_content', 'trim_content');
function trim_content($content){
if(is_archive()){
//use your own trick to get the first 50 words. I'm getting the first 200 characters just to show an example.
$more = (strlen($content) <= 500) ? "" : " [...] ";
$content = '
' . wp_html_excerpt($content, 500) . $more . '
';
}
return $content;
}
/*******************************************************************************
* Filter to lower the context to a summary length for archive templates only
*/
function the_titlesmall($before = '', $after = '', $echo = true, $length = false) {
$title = get_the_title();
if ( $length && is_numeric($length) ) {
$title = substr( $title, 0, $length );
}
if ( strlen($title)> 0 ) {
$title = apply_filters('the_titlesmall', $before . $title . $after, $before, $after);
if ( $echo ) {
echo $title;
} else {
echo $title;
}
} else {
echo "Untitled-Entry";
}
}
/*******************************************************************************
* Template for comments and pingbacks
*/
if ( ! function_exists( 'bootstrap_comment' ) ) {
function bootstrap_comment( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
switch ( $comment->comment_type ) :
case 'pingback' :
case 'trackback' :
// Display trackbacks differently than normal comments.
?>