'ffffff',
));
add_image_size( 'security-camera-featured-image', 2000, 1200, true );
add_image_size( 'security-camera-thumbnail-avatar', 100, 100, true );
$GLOBALS['content_width'] = 525;
register_nav_menus( array(
'primary' => __( 'Primary Menu', 'security-camera' ),
) );
add_theme_support( 'html5', array(
'comment-form',
'comment-list',
'gallery',
'caption',
) );
// Add theme support for Custom Logo.
add_theme_support( 'custom-logo', array(
'width' => 250,
'height' => 250,
'flex-width' => true,
'flex-height' => true,
) );
/*
* This theme styles the visual editor to resemble the theme style,
* specifically font, colors, and column width.
*/
add_editor_style( array( 'assets/css/editor-style.css' ) );
if ( ! defined( 'CYBER_SECURITY_SERVICES_SUPPORT' ) ) {
define('CYBER_SECURITY_SERVICES_SUPPORT',__('https://wordpress.org/support/theme/cyber-security-services/','cyber-security-services'));
}
if ( ! defined( 'CYBER_SECURITY_SERVICES_REVIEW' ) ) {
define('CYBER_SECURITY_SERVICES_REVIEW',__('https://wordpress.org/support/theme/cyber-security-services/reviews/','cyber-security-services'));
}
if ( ! defined( 'CYBER_SECURITY_SERVICES_LIVE_DEMO' ) ) {
define('CYBER_SECURITY_SERVICES_LIVE_DEMO',__('https://trial.ovationthemes.com/cyber-security-services/','cyber-security-services'));
}
if ( ! defined( 'CYBER_SECURITY_SERVICES_BUY_PRO' ) ) {
define('CYBER_SECURITY_SERVICES_BUY_PRO',__('https://www.ovationthemes.com/products/wordpress-cyber-security-theme','cyber-security-services'));
}
if ( ! defined( 'CYBER_SECURITY_SERVICES_PRO_DOC' ) ) {
define('CYBER_SECURITY_SERVICES_PRO_DOC',__('https://trial.ovationthemes.com/docs/ot-cyber-security-services-pro-doc/','cyber-security-services'));
}
if ( ! defined( 'CYBER_SECURITY_SERVICES_FREE_DOC' ) ) {
define('CYBER_SECURITY_SERVICES_FREE_DOC',__('https://trial.ovationthemes.com/docs/ot-cyber-security-services-free-doc/','cyber-security-services'));
}
if ( ! defined( 'CYBER_SECURITY_SERVICES_THEME_NAME' ) ) {
define('CYBER_SECURITY_SERVICES_THEME_NAME',__('Premium Cyber Security Theme','cyber-security-services'));
}
}
add_action( 'after_setup_theme', 'security_camera_setup' );
// widgets
function security_camera_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'security-camera' ),
'id' => 'sidebar-1',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'security-camera' ),
'before_widget' => '',
'before_title' => '
',
) );
register_sidebar( array(
'name' => __( 'Sidebar 3', 'security-camera' ),
'id' => 'sidebar-3',
'description' => __( 'Add widgets here to appear in your sidebar on blog posts and archive pages.', 'security-camera' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Page Sidebar', 'security-camera' ),
'id' => 'sidebar-2',
'description' => __( 'Add widgets here to appear in your pages and posts', 'security-camera' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 1', 'security-camera' ),
'id' => 'footer-1',
'description' => __( 'Add widgets here to appear in your footer.', 'security-camera' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 2', 'security-camera' ),
'id' => 'footer-2',
'description' => __( 'Add widgets here to appear in your footer.', 'security-camera' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 3', 'security-camera' ),
'id' => 'footer-3',
'description' => __( 'Add widgets here to appear in your footer.', 'security-camera' ),
'before_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => __( 'Footer 4', 'security-camera' ),
'id' => 'footer-4',
'description' => __( 'Add widgets here to appear in your footer.', 'security-camera' ),
'before_widget' => '',
'before_title' => '',
) );
}
add_action( 'widgets_init', 'security_camera_widgets_init' );
// comments
function security_camera_enqueue_comments_reply() {
if( is_singular() && comments_open() && ( get_option( 'thread_comments' ) == 1) ) {
// Load comment-reply.js (into footer)
wp_enqueue_script( 'comment-reply', '/wp-includes/js/comment-reply.min.js', array(), false, true );
}
}
add_action('wp_enqueue_scripts', 'security_camera_enqueue_comments_reply');
// Footer Text
function security_camera_copyright_link() {
$security_camera_footer_text = get_theme_mod('security_camera_footer_text', esc_html__('Security Camera WordPress Theme', 'security-camera'));
$security_camera_credit_link = esc_url('https://www.ovationthemes.com/products/free-cctv-security-wordpress-theme');
echo '' . esc_html($security_camera_footer_text) . '';
}
// remove sections
function security_camera_customize_register() {
global $wp_customize;
$wp_customize->remove_section( 'cyber_security_services_pro' );
$wp_customize->remove_section( 'cyber_security_services_product_box_section' );
$wp_customize->remove_setting('cyber_security_services_slider_content_alignment');
$wp_customize->remove_control('cyber_security_services_slider_content_alignment');
$wp_customize->remove_setting('cyber_security_services_footer_text');
$wp_customize->remove_control('cyber_security_services_footer_text');
$wp_customize->remove_setting('cyber_security_services_secondary_color');
$wp_customize->remove_control('cyber_security_services_secondary_color');
$wp_customize->remove_setting('cyber_security_services_primary_color');
$wp_customize->remove_control('cyber_security_services_primary_color');
$wp_customize->remove_setting('cyber_security_services_primary_fade');
$wp_customize->remove_control('cyber_security_services_primary_fade');
$wp_customize->remove_setting('cyber_security_services_slider_opacity');
$wp_customize->remove_control('cyber_security_services_slider_opacity');
$wp_customize->remove_setting('cyber_security_services_slider_excerpt_color');
$wp_customize->remove_control('cyber_security_services_slider_excerpt_color');
}
add_action( 'customize_register', 'security_camera_customize_register', 11 );
// customizer
function security_camera_customize( $wp_customize ) {
wp_enqueue_style('customizercustom_css', esc_url( get_stylesheet_directory_uri() ). '/assets/css/customizer.css');
require get_theme_file_path( 'inc/custom-control.php' );
// pro section
$wp_customize->add_section('security_camera_pro', array(
'title' => __('🔒 Unlock Premium Features', 'security-camera'),
'priority' => 1,
));
$wp_customize->add_setting('security_camera_pro', array(
'default' => null,
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(new Security_Camera_Pro_Control($wp_customize, 'security_camera_pro', array(
'label' => __('SECURITY CAMERA PREMIUM', 'security-camera'),
'section' => 'security_camera_pro',
'settings' => 'security_camera_pro',
'priority' => 1,
)));
$wp_customize->add_setting('security_camera_slider_excerpt_color', array(
'default' => '#ffffff',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'security_camera_slider_excerpt_color', array(
'section' => 'cyber_security_services_slider_section',
'label' => esc_html__('Slider Excerpt Color', 'security-camera'),
'priority' => 4,
)));
// slider content alignmnet
$wp_customize->add_setting('security_camera_slider_content_alignment',array(
'default' => 'RIGHT-ALIGN',
'sanitize_callback' => 'cyber_security_services_sanitize_choices'
));
$wp_customize->add_control('security_camera_slider_content_alignment',array(
'type' => 'radio',
'label' => __('Slider Content Alignment', 'security-camera'),
'section' => 'cyber_security_services_slider_section',
'type' => 'select',
'choices' => array(
'LEFT-ALIGN' => __('LEFT','security-camera'),
'CENTER-ALIGN' => __('CENTER','security-camera'),
'RIGHT-ALIGN' => __('RIGHT','security-camera'),
),
'priority' => 6,
) );
$wp_customize->add_setting('security_camera_slider_opacity',array(
'default' => '1',
'sanitize_callback' => 'cyber_security_services_sanitize_choices'
));
$wp_customize->add_control('security_camera_slider_opacity',array(
'type' => 'radio',
'label' => __('Slider Opacity', 'security-camera'),
'section' => 'cyber_security_services_slider_section',
'type' => 'select',
'choices' => array(
'0' => __('0','security-camera'),
'0.1' => __('0.1','security-camera'),
'0.2' => __('0.2','security-camera'),
'0.3' => __('0.3','security-camera'),
'0.4' => __('0.4','security-camera'),
'0.5' => __('0.5','security-camera'),
'0.6' => __('0.6','security-camera'),
'0.7' => __('0.7','security-camera'),
'0.8' => __('0.8','security-camera'),
'0.9' => __('0.9','security-camera'),
'1' => __('1','security-camera')
),
) );
// Services Section
$wp_customize->add_section( 'security_camera_middle_section' , array(
'title' => __( 'Services Settings', 'security-camera' ),
'priority' => 4,
'panel' => 'cyber_security_services_custompage_panel',
) );
$wp_customize->add_setting( 'security_camera_section_about_heading', array(
'default' => '',
'transport' => 'refresh',
'sanitize_callback' => 'sanitize_text_field',
) );
$wp_customize->add_control( new Security_Camera_Customizer_Customcontrol_Section_Heading( $wp_customize, 'security_camera_section_about_heading', array(
'label' => esc_html__( 'Services Section Settings', 'security-camera' ),
'section' => 'security_camera_middle_section',
'settings' => 'security_camera_section_about_heading',
) ) );
$wp_customize->add_setting(
'security_camera_middle_show_hide',
array(
'type' => 'option',
'capability' => 'edit_theme_options',
'theme_supports' => '',
'default' => '1',
'transport' => 'refresh',
'sanitize_callback' => 'cyber_security_services_callback_sanitize_switch',
)
);
$wp_customize->add_control(
new Security_Camera_Customizer_Customcontrol_Switch(
$wp_customize,
'security_camera_middle_show_hide',
array(
'settings' => 'security_camera_middle_show_hide',
'section' => 'security_camera_middle_section',
'label' => __( 'Check To Show Section', 'security-camera' ),
'choices' => array(
'1' => __( 'On', 'security-camera' ),
'off' => __( 'Off', 'security-camera' ),
),
'active_callback' => '',
)
)
);
$wp_customize->add_setting('security_camera_middle_heading',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('security_camera_middle_heading',array(
'label' => esc_html__('Heading','security-camera'),
'section' => 'security_camera_middle_section',
'setting' => 'security_camera_middle_heading',
'type' => 'text'
));
$wp_customize->add_setting('security_camera_middle_title',array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('security_camera_middle_title',array(
'label' => esc_html__('Title','security-camera'),
'section' => 'security_camera_middle_section',
'setting' => 'security_camera_middle_title',
'type' => 'text'
));
$security_camera_args = array('numberposts' => -1);
$security_camera_post_list = get_posts($security_camera_args);
$s = 0;
$security_camera_pst_sls[]= __('Select','security-camera');
foreach ($security_camera_post_list as $key => $security_camera_p_post) {
$security_camera_pst_sls[$security_camera_p_post->ID]=$security_camera_p_post->post_title;
}
for ( $s = 1; $s <= 6; $s++ ) {
$wp_customize->add_setting('security_camera_mid_section_icon'.$s,array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('security_camera_mid_section_icon'.$s,array(
'label' => esc_html__('Icon','security-camera'),
'input_attrs' => array(
'placeholder' => __( 'fas fa-envelope','security-camera' ),
),
'section' => 'security_camera_middle_section',
'setting' => 'security_camera_mid_section_icon',
'type' => 'text'
));
$wp_customize->add_setting('security_camera_middle_sec_settigs'.$s,array(
'sanitize_callback' => 'cyber_security_services_sanitize_choices',
));
$wp_customize->add_control('security_camera_middle_sec_settigs'.$s,array(
'type' => 'select',
'choices' => $security_camera_pst_sls,
'label' => __('Select post','security-camera'),
'section' => 'security_camera_middle_section',
));
}
wp_reset_postdata();
//footer
$wp_customize->add_setting('security_camera_footer_text',array(
'default' => 'Security Camera WordPress Theme',
'sanitize_callback' => 'sanitize_text_field'
));
$wp_customize->add_control('security_camera_footer_text',array(
'label' => esc_html__('Copyright Text','security-camera'),
'section' => 'cyber_security_services_footer_copyright',
'type' => 'textarea'
));
$wp_customize->add_setting('security_camera_primary_color', array(
'default' => '#108bea',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'security_camera_primary_color', array(
'section' => 'colors',
'label' => esc_html__('Theme Color', 'security-camera'),
)));
$wp_customize->add_setting('security_camera_primary_fade', array(
'default' => '#e5f4ff',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'refresh',
));
$wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'security_camera_primary_fade', array(
'section' => 'colors',
'label' => esc_html__('theme Color Light', 'security-camera'),
)));
}
add_action( 'customize_register', 'security_camera_customize' );
/* Pro control */
if (class_exists('WP_Customize_Control') && !class_exists('Security_Camera_Pro_Control')):
class Security_Camera_Pro_Control extends WP_Customize_Control{
public function render_content(){?>