esc_html__( 'Main Menu', 'pages' ), 'footer-menu' => esc_html__( 'Footer Menu', 'pages' ), 'social-menu' => esc_html__( 'Social Menu', 'pages' ) ) );
}
add_action( 'wp_enqueue_scripts', 'pages_enqueue' );
function pages_enqueue() {
wp_enqueue_style( 'pages-style', get_stylesheet_uri() );
wp_enqueue_script( 'jquery' );
wp_register_script( 'pages-videos', get_template_directory_uri() . '/js/videos.js' );
wp_enqueue_script( 'pages-videos' );
wp_add_inline_script( 'pages-videos', 'jQuery(document).ready(function($){$("#wrapper").vids();});' );
}
add_action( 'wp_footer', 'pages_footer' );
function pages_footer() {
?>
' . esc_html__( 'Skip to the content', 'pages' ) . '';
}
add_filter( 'the_content_more_link', 'pages_read_more_link' );
function pages_read_more_link() {
if ( !is_admin() ) {
return ' ' . sprintf( __( '...%s', 'pages' ), ' ' . esc_html( get_the_title() ) . '' ) . '';
}
}
add_filter( 'excerpt_more', 'pages_excerpt_read_more_link' );
function pages_excerpt_read_more_link( $more ) {
if ( !is_admin() ) {
global $post;
return ' ' . sprintf( __( '...%s', 'pages' ), ' ' . esc_html( get_the_title() ) . '' ) . '';
}
}
add_filter( 'big_image_size_threshold', '__return_false' );
add_filter( 'intermediate_image_sizes_advanced', 'pages_image_insert_override' );
function pages_image_insert_override( $sizes ) {
unset( $sizes['medium_large'] );
unset( $sizes['1536x1536'] );
unset( $sizes['2048x2048'] );
return $sizes;
}
add_action( 'widgets_init', 'pages_widgets_init' );
function pages_widgets_init() {
register_sidebar( array(
'name' => esc_html__( 'Header Widget Area', 'pages' ),
'id' => 'header-widget-area',
'before_widget' => '
',
'after_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Sidebar Widget Area', 'pages' ),
'id' => 'sidebar-widget-area',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
register_sidebar( array(
'name' => esc_html__( 'Footer Widget Area', 'pages' ),
'id' => 'footer-widget-area',
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
) );
}
add_action( 'wp_head', 'pages_pingback_header' );
function pages_pingback_header() {
if ( is_singular() && pings_open() ) {
printf( '' . "\n", esc_url( get_bloginfo( 'pingback_url' ) ) );
}
}
add_action( 'comment_form_before', 'pages_enqueue_comment_reply_script' );
function pages_enqueue_comment_reply_script() {
if ( get_option( 'thread_comments' ) ) {
wp_enqueue_script( 'comment-reply' );
}
}
function pages_custom_pings( $comment ) {
?>
id="li-comment-">
remove_control( 'blogdescription' );
$wp_customize->remove_control( 'header_textcolor' );
$wp_customize->remove_control( 'display_header_text' );
$wp_customize->add_setting(
'pages_accent_color',
array(
'default' => '#007acc',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage'
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'accent_color',
array(
'label' => esc_html__( 'Accent Color', 'pages' ),
'section' => 'colors',
'settings' => 'pages_accent_color'
)
)
);
$wp_customize->add_setting(
'pages_social_color',
array(
'default' => '#007acc',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage'
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'social_color',
array(
'label' => esc_html__( 'Social Icons Color', 'pages' ),
'section' => 'colors',
'settings' => 'pages_social_color'
)
)
);
$wp_customize->add_setting(
'pages_link_color',
array(
'default' => '#007acc',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage'
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'link_color',
array(
'label' => esc_html__( 'Link Color', 'pages' ),
'section' => 'colors',
'settings' => 'pages_link_color'
)
)
);
$wp_customize->add_setting(
'pages_header_color',
array(
'default' => '#007acc',
'sanitize_callback' => 'sanitize_hex_color',
'transport' => 'postMessage'
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'header_color',
array(
'label' => esc_html__( 'Headers Color', 'pages' ),
'section' => 'colors',
'settings' => 'pages_header_color'
)
)
);
$wp_customize->add_section(
'pages_options',
array(
'title' => __( 'Display Options', 'pages' ),
'priority' => 0
)
);
$wp_customize->add_setting(
'pages_hide_header',
array(
'default' => '',
'sanitize_callback' => 'pages_sanitize_checkbox'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'hide_header',
array(
'label' => esc_html__( 'Hide Header', 'pages' ),
'section' => 'pages_options',
'settings' => 'pages_hide_header',
'type' => 'checkbox',
)
)
);
$wp_customize->add_setting(
'pages_hide_branding',
array(
'default' => '',
'sanitize_callback' => 'pages_sanitize_checkbox'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'hide_branding',
array(
'label' => esc_html__( 'Hide Logo/Site Title', 'pages' ),
'section' => 'pages_options',
'settings' => 'pages_hide_branding',
'type' => 'checkbox',
)
)
);
$wp_customize->add_setting(
'pages_hide_menu',
array(
'default' => '',
'sanitize_callback' => 'pages_sanitize_checkbox'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'hide_menu',
array(
'label' => esc_html__( 'Hide Menu', 'pages' ),
'section' => 'pages_options',
'settings' => 'pages_hide_menu',
'type' => 'checkbox',
)
)
);
$wp_customize->add_setting(
'pages_hide_search',
array(
'default' => '',
'sanitize_callback' => 'pages_sanitize_checkbox'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'hide_search',
array(
'label' => esc_html__( 'Hide Search Form', 'pages' ),
'section' => 'pages_options',
'settings' => 'pages_hide_search',
'type' => 'checkbox',
)
)
);
$wp_customize->add_setting(
'pages_hide_footer',
array(
'default' => '',
'sanitize_callback' => 'pages_sanitize_checkbox'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'hide_footer',
array(
'label' => esc_html__( 'Hide Footer', 'pages' ),
'section' => 'pages_options',
'settings' => 'pages_hide_footer',
'type' => 'checkbox',
)
)
);
$wp_customize->add_section(
'pages_fonts',
array(
'title' => esc_html__( 'Fonts', 'pages' ),
'priority' => 25
)
);
$wp_customize->add_setting(
'pages_header_font',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'transport' => 'refresh'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'header_font',
array(
'label' => esc_html__( 'Headers Font', 'pages' ),
'description' => 'Google fonts allowed here too.',
'section' => 'pages_fonts',
'settings' => 'pages_header_font'
)
)
);
$wp_customize->add_section(
'pages_footer',
array(
'title' => esc_html__( 'Footer', 'pages' ),
'priority' => 120
)
);
$wp_customize->add_setting(
'pages_copyright',
array(
'default' => '',
'sanitize_callback' => 'sanitize_text_field',
'transport' => 'refresh'
)
);
$wp_customize->add_control(
new WP_Customize_Control(
$wp_customize,
'copyright',
array(
'label' => esc_html__( '© Copyright', 'pages' ),
'section' => 'pages_footer',
'settings' => 'pages_copyright'
)
)
);
$wp_customize->add_section(
'pages_code',
array(
'title' => esc_html__( 'Additional Code', 'pages' ),
'description' => esc_html__( 'Add additional HTML and JS as needed.', 'pages' ),
'priority' => 200
)
);
$wp_customize->add_setting(
'pages_custom_header_code',
array(
'default' => '',
'sanitize_callback' => 'wp_kses_post',
'transport' => 'refresh'
)
);
$wp_customize->add_control(
new WP_Customize_Code_Editor_Control(
$wp_customize,
'custom_header_code',
array(
'description' => esc_html__( 'Add code to <head>', 'pages' ),
'code_type' => 'html',
'settings' => 'pages_custom_header_code',
'section' => 'pages_code',
)
)
);
$wp_customize->add_setting(
'pages_custom_body_code',
array(
'default' => '',
'sanitize_callback' => 'wp_kses_post',
'transport' => 'refresh'
)
);
$wp_customize->add_control(
new WP_Customize_Code_Editor_Control(
$wp_customize,
'custom_body_code',
array(
'description' => esc_html__( 'Add code just after <body>', 'pages' ),
'code_type' => 'html',
'settings' => 'pages_custom_body_code',
'section' => 'pages_code',
)
)
);
$wp_customize->add_setting(
'pages_custom_footer_code',
array(
'default' => '',
'sanitize_callback' => 'wp_kses_post',
'transport' => 'refresh'
)
);
$wp_customize->add_control(
new WP_Customize_Code_Editor_Control(
$wp_customize,
'custom_footer_code',
array(
'description' => esc_html__( 'Add code just before </body>', 'pages' ),
'code_type' => 'html',
'settings' => 'pages_custom_footer_code',
'section' => 'pages_code',
)
)
);
}
add_action( 'wp_head', 'pages_header_code' );
function pages_header_code() {
$headercode = get_theme_mod( 'pages_custom_header_code', '' );
if ( '' === $headercode ) {
return;
}
echo $headercode . "\n";
}
add_action( 'wp_body_open', 'pages_body_code' );
function pages_body_code() {
$bodycode = get_theme_mod( 'pages_custom_body_code', '' );
if ( '' === $bodycode ) {
return;
}
echo $bodycode . "\n";
}
add_action( 'wp_footer', 'pages_footer_code' );
function pages_footer_code() {
$footercode = get_theme_mod( 'pages_custom_footer_code', '' );
if ( '' === $footercode ) {
return;
}
echo $footercode . "\n";
}
function pages_sanitize_checkbox( $input ) {
if ( $input === true || $input === '1' ) {
return '1';
}
return '';
}
add_action( 'wp_head', 'pages_customizer_css' );
function pages_customizer_css() {
?>