tag in the document head, and expect WordPress to
* provide it for us.
*/
add_theme_support( 'title-tag' );
/*
* Enable support for Post Thumbnails on posts and pages.
*
* @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/
*/
add_theme_support( 'post-thumbnails' );
add_image_size( 'cyclone-business-slider', 1600, 650, true );
add_image_size( 'cyclone-business-services', 262, 254, true );
add_image_size( 'cyclone-business-blogs', 262, 151, true );
add_image_size( 'cyclone-business-works', 358, 203, true );
// This theme uses wp_nav_menu() in one location.
register_nav_menus( array(
'primary' => esc_html__( 'Primary', 'cyclone-business' ),
) );
/*
* Switch default core markup for search form, comment form, and comments
* to output valid HTML5.
*/
add_theme_support( 'html5', array(
'search-form',
'comment-form',
'comment-list',
'gallery',
'caption',
) );
/*
* Enable support for Post Formats.
* See https://developer.wordpress.org/themes/functionality/post-formats/
*/
add_theme_support( 'post-formats', array(
'aside',
'image',
'video',
'quote',
'link',
) );
// Set up the WordPress core custom background feature.
add_theme_support( 'custom-background', apply_filters( 'cyclone_business_custom_background_args', array(
'default-color' => 'ffffff',
'default-image' => '',
) ) );
}
endif;
add_action( 'after_setup_theme', 'cyclone_business_setup' );
add_action( 'init', 'my_register_nav_menus' );
function my_register_nav_menus() {
register_nav_menu( 'social', __( 'Social', 'cyclone-business' ) );
}
/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function cyclone_business_content_width() {
$GLOBALS['content_width'] = apply_filters( 'cyclone_business_content_width', 640 );
}
add_action( 'after_setup_theme', 'cyclone_business_content_width', 0 );
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function cyclone_business_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Sidebar', 'cyclone-business' ),
'id' => 'sidebar-1',
'description' => '',
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer I', 'cyclone-business' ),
'id' => 'sidebar-2',
'description' => '',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer II', 'cyclone-business' ),
'id' => 'sidebar-3',
'description' => '',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer III', 'cyclone-business' ),
'id' => 'sidebar-4',
'description' => '',
'before_widget' => '',
'before_title' => '',
'after_title' => '
',
) );
}
add_action( 'widgets_init', 'cyclone_business_widgets_init' );
/** Function to add class to body **/
add_filter( 'body_class', 'pc_add_featured_image_body_class' );
function pc_add_featured_image_body_class( $classes ) {
$bclass = get_theme_mod('sidebar_placement','right');
//echo "side".$bclass;
$pclass = get_theme_mod('sidebar_page','yes');
// if ( ! is_single() || ! is_page() ) {
// return $classes;
// } else
if ( is_single() ) {
//$classes[] = $bclass;
array_push( $classes, $bclass );
}
// } elseif ( is_page() ) {
// $classes[] = $pclass;
// }
return $classes;
}
/**
* Enqueue scripts and styles.
*/
function cyclone_business_scripts() {
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css');
wp_enqueue_style( 'cyclone-business-custom-css', get_template_directory_uri() . '/assets/css/custom.css');
wp_enqueue_style( 'cyclone-business-style', get_stylesheet_uri() );
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/assets/font-awesome/css/font-awesome.css');
wp_enqueue_style( 'lightbox', get_template_directory_uri() . '/assets/css/lightbox.css');
wp_enqueue_style( 'meanmenu', get_template_directory_uri() . '/assets/css/meanmenu.css');
wp_enqueue_style( 'cyclone-business-responsive', get_template_directory_uri() . '/assets/css/responsive.css');
wp_enqueue_script( 'cyclone-business-navigation', get_template_directory_uri() . '/js/navigation.js', array('jquery'), '20151215', true );
wp_enqueue_script( 'cyclone-business-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array('jquery'), '20151215', true );
wp_enqueue_script( 'bootstrap-min', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery'), '20151215', true );
wp_enqueue_script( 'lightbox-min', get_template_directory_uri() . '/assets/js/lightbox.min.js', array('jquery'), '20151215', true );
wp_enqueue_script( 'cyclone-business-mean-menu', get_template_directory_uri() . '/assets/js/jquery.meanmenu.js', array('jquery'), '20151215', true );
wp_enqueue_script( 'cyclone-business-navigation-js', get_template_directory_uri() . '/js/navigation.js', array('jquery'), '20151215', true );
wp_enqueue_script( 'cyclone-business-custom', get_template_directory_uri() . '/js/custom.js', array('jquery'), '20151215', true );
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
add_action( 'wp_enqueue_scripts', 'cyclone_business_scripts' );
/**
* Read me text
*/
function cyclone_business_excerpt_more($more) {
$more=get_theme_mod('exc_text','Read more');
global $post;
return ''.$more.'';
}
add_filter('excerpt_more', 'cyclone_business_excerpt_more');
/**
* Excerpt length
*/
function cyclone_business_excerpt_length($length) {
$length=get_theme_mod('exc_len');
return $length;
}
add_filter('excerpt_length', 'cyclone_business_excerpt_length');
/**
* Implement the Custom Header feature.
*/
require get_template_directory() . '/inc/custom-header.php';
/**
* Custom template tags for this theme.
*/
require get_template_directory() . '/inc/template-tags.php';
/**
* Custom functions that act independently of the theme templates.
*/
require get_template_directory() . '/inc/extras.php';
/**
* Customizer additions.
*/
require get_template_directory() . '/inc/customizer.php';
/**
* Load Jetpack compatibility file.
*/
require get_template_directory() . '/inc/jetpack.php';
require get_template_directory() . '/inc/widgets.php';
add_action( 'init', 'my_add_excerpts_to_pages' );
function my_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}