/i', $post->post_content, $matches)){
$first_img = $matches [1] [0];
}
return $first_img;
}
function howlthemes_foot(){?>
-
-
-
-
-
add_section(
'headersection',
array(
'title' => __( 'Header', 'aqueduct' ),
'description' => __( 'Choose style for header', 'aqueduct' ),
'priority' => 30,
)
);
$wp_customize->add_setting(
'imageradio',
array(
'default' => 'default',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
new aqueduct_radio_image(
$wp_customize,
'imageradio',
array(
'section' => 'headersection',
'settings' => 'imageradio'
)
)
);
// Styling Panel
$wp_customize->add_panel( 'styling', array(
'title' => __( 'Styling', 'aqueduct'),
'priority' => 60, // Mixed with top-level-section hierarchy.
) );
//Theme Layout
$wp_customize->add_section( 'howl-themes_layout_section' , array(
'title' => __( 'Choose layout', 'aqueduct' ),
'priority' => 30,
'panel' => 'styling',
) );
$wp_customize->add_setting(
'layout_placement',
array(
'default' => 'full',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control(
'layout_placement',
array(
'type' => 'radio',
'label' => __('Theme Layout', 'aqueduct' ),
'section' => 'howl-themes_layout_section',
'choices' => array(
'full' => 'Full Width',
'boxed' => 'Boxed',
),
)
);
//Background Image
$wp_customize->add_section( 'howl-themes_bg_img' , array(
'title' => __( 'Background Image', 'aqueduct' ),
'priority' => 30,
'description' => __('It will work only if theme layout is Boxed', 'aqueduct' ),
'panel' => 'styling',
) );
$wp_customize->add_setting( 'howl-themes_bgimg',
array ( 'default' => '',
'sanitize_callback' => 'esc_url_raw'
));
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'howl-themes_bgimg', array(
'section' => 'howl-themes_bg_img',
'settings' => 'howl-themes_bgimg',
) ) );
// Home Panel
$wp_customize->add_panel( 'frontpage', array(
'title' => __( 'Home Page Setting', 'aqueduct'),
'priority' => 40, // Mixed with top-level-section hierarchy.
) );
//Home Page Display
$wp_customize->add_section( 'howl-themes_magazine' , array(
'title' => __( 'Front Page', 'aqueduct' ),
'priority' => 30,
'panel' => 'frontpage',
) );
$wp_customize->add_setting(
'home_display',
array(
'default' => 'blog',
'sanitize_callback' => 'sanitize_key',
)
);
$wp_customize->add_control(
'home_display',
array(
'type' => 'radio',
'label' => __( 'Home Page Display', 'aqueduct' ),
'section' => 'howl-themes_magazine',
'choices' => array(
'blog' => __( 'Latest posts - Blog Layout', 'aqueduct' ),
'magazine' => __( 'News Boxes - use Home Builder', 'aqueduct' ),
),
)
);
//Slider
$wp_customize->add_section( 'howl-themes_newsbox_one' , array(
'title' => __( 'News Boxes', 'aqueduct' ),
'priority' => 30,
'panel' => 'frontpage',
) );
$wp_customize->add_setting(
'homebuilder',
array(
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
new aqueduct_homebuilder_Control(
$wp_customize,
'homebuilder',
array(
'section' => 'howl-themes_newsbox_one',
'settings' => 'homebuilder'
)
)
);
$wp_customize->add_setting(
'category_remember',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'category_remember',
array(
'section' => 'howl-themes_newsbox_one',
'type' => 'text',
)
);
//Theme color
$wp_customize->add_section( 'howl-themes_theme_color' , array(
'title' => __( 'Theme Color', 'aqueduct' ),
'priority' => 30,
'panel' => 'styling',
) );
$wp_customize->add_setting(
'color-setting',
array(
'default' => '#d23f50',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'color-setting',
array(
'label' => __('Choose Color', 'aqueduct' ),
'section' => 'howl-themes_theme_color',
'settings' => 'color-setting',
)
)
);
//Link color
$wp_customize->add_section( 'howl-themes_link_color' , array(
'title' => __( 'Link Color', 'aqueduct' ),
'priority' => 30,
'panel' => 'styling',
) );
$wp_customize->add_setting(
'linkcolor-setting',
array(
'default' => '#333333',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'linkcolor-setting',
array(
'label' => __( 'Link Color', 'aqueduct' ),
'section' => 'howl-themes_link_color',
'settings' => 'linkcolor-setting',
)
)
);
$wp_customize->add_setting(
'linkcolorhover-setting',
array(
'default' => '#000000',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'linkcolorhover-setting',
array(
'label' => __( 'Link Hover Color', 'aqueduct' ),
'section' => 'howl-themes_link_color',
'settings' => 'linkcolorhover-setting',
)
)
);
//Typography
$wp_customize->add_panel( 'typo', array(
'title' => __( 'Typography', 'aqueduct'),
'priority' => 80, // Mixed with top-level-section hierarchy.
) );
$wp_customize->add_section( 'howl-themes_typography' , array(
'title' => __( 'Choose Font', 'aqueduct' ),
'priority' => 30,
'panel' => 'typo',
) );
$wp_customize->add_setting(
'typography-setting',
array(
'default' => 'Titillium Web',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
'typography-setting',
array(
'type' => 'select',
'section' => 'howl-themes_typography',
'choices' => array(
'Playfair Display' => 'Playfair Display',
'Work Sans' => 'Work Sans',
'Alegreya' => 'Alegreya',
'Alegreya Sans' => 'Alegreya Sans',
'Inconsolata' => 'Inconsolata',
'Source Sans Pro' => 'Source Sans Pro',
'Source Serif Pro' => 'Source Serif Pro',
'Neuton' => 'Neuton',
'Poppins' => 'Poppins',
'Crimson Text' => 'Crimson Text',
'Archivo Narrow' => 'Archivo Narrow',
'Libre Baskerville' => 'Libre Baskerville',
'Roboto' => 'Roboto',
'Karla' => 'Karla',
'Lora' => 'Lora',
'Chivo' => 'Chivo',
'Domine' => 'Domine',
'Old Standard TT' => 'Old Standard TT',
'Varela Round' => 'Varela Round',
'Open Sans' => 'Open Sans',
'Raleway' => 'Raleway',
'Josefin Sans' => 'Josefin Sans',
'Oswald' => 'Oswald',
'PT Sans' => 'PT Sans',
'Merriweather' => 'Merriweather',
'Lato' => 'Lato',
'Ubuntu' => 'Ubuntu',
'Bitter' => 'Bitter',
'Cardo' => 'Cardo',
'Arvo' => 'Arvo',
'Montserrat' => 'Montserrat',
'Rajdhani' => 'Rajdhani',
'Droid Sans' => 'Droid Sans',
'PT Serif' => 'PT Serif',
'Dosis' => 'Dosis',
'Titillium Web' => 'Titillium Web',
'Cabin' => 'Cabin',
'Hind' => 'Hind',
'Catamaran' => 'Catamaran',
'Signika' => 'Signika',
'Exo' => 'Exo',
),
)
);
$wp_customize->add_section( 'howl-themes_fontcolor' , array(
'title' => __( 'Font color', 'aqueduct' ),
'priority' => 30,
'panel' => 'typo',
) );
$wp_customize->add_setting(
'fontcolor-setting',
array(
'default' => '#000000',
'sanitize_callback' => 'sanitize_hex_color',
)
);
$wp_customize->add_control(
new WP_Customize_Color_Control(
$wp_customize,
'fontcolor-setting',
array(
'label' => __( 'Font Color', 'aqueduct' ),
'section' => 'howl-themes_fontcolor',
'settings' => 'fontcolor-setting',
)
)
);
/**
* Adds input number support to the theme customizer
*/
class aqueduct_Customize_Textarea_Control extends WP_Customize_Control {
public $type = 'fontsize';
public function render_content() {
?>
add_section( 'howl-themes_fontsize' , array(
'title' => __( 'Font size', 'aqueduct' ),
'priority' => 30,
'panel' => 'typo',
) );
$wp_customize->add_setting(
'fontsize',
array(
'default' => '18',
'sanitize_callback' => 'sanitize_text_field',
)
);
$wp_customize->add_control(
new aqueduct_Customize_Textarea_Control(
$wp_customize,
'fontsize',
array(
'section' => 'howl-themes_fontsize',
'settings' => 'fontsize'
)
)
);
//Social
$wp_customize->add_section(
'social_icons',
array(
'title' => 'Social',
'description' => __( 'Add URLs', 'aqueduct' ),
'priority' => 60,
)
);
$wp_customize->add_setting(
'fsocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'fsocial_url',
array(
'label' => __( 'Facebook', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->add_setting(
'tsocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'tsocial_url',
array(
'label' => __( 'Twitter', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->add_setting(
'gsocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'gsocial_url',
array(
'label' => __( 'Google+', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->add_setting(
'psocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'psocial_url',
array(
'label' => __( 'Pinterest', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->add_setting(
'isocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'isocial_url',
array(
'label' => __( 'Instagram', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->add_setting(
'lsocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'lsocial_url',
array(
'label' => __( 'Linkedin', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->add_setting(
'ysocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'ysocial_url',
array(
'label' => __( 'Youtube', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->add_setting(
'rsocial_url',
array(
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control(
'rsocial_url',
array(
'label' => __( 'RSS', 'aqueduct' ),
'section' => 'social_icons',
'type' => 'text',
)
);
$wp_customize->remove_section('static_front_page');
}
add_action( 'customize_register', 'howlthemes_customizer' );
/**
* Enqueue script for custom customize control.
*/
function custom_customize_enqueue() {
wp_enqueue_script( 'jqueryui-customize', '//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js', array( 'jquery', 'customize-controls' ), true );
wp_enqueue_script( 'customjs-customize', get_template_directory_uri() . '/js/customizer.js', array( 'jquery', 'customize-controls' ), true );
}
add_action( 'customize_controls_enqueue_scripts', 'custom_customize_enqueue' );