mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-21 04:11:59 +08:00
spacing and other fun stuff
This commit is contained in:
parent
202cc2d2e6
commit
f8d11ced0f
10 changed files with 352 additions and 353 deletions
|
@ -4,7 +4,7 @@
|
|||
* Sets up the welcome screen page, hides the menu item
|
||||
* and contains the screen content.
|
||||
*/
|
||||
class storefront_welcome {
|
||||
class Storefront_Welcome {
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -147,10 +147,10 @@ class storefront_welcome {
|
|||
*/
|
||||
public function storefront_welcome_getting_started() {
|
||||
// get theme customizer url
|
||||
$url = admin_url() . 'customize.php?';
|
||||
$url .= 'url=' . urlencode( site_url() . '?storefront-customizer=true' ) ;
|
||||
$url .= '&return=' . urlencode( admin_url() . 'themes.php?page=storefront-welcome' );
|
||||
$url .= '&storefront-customizer=true';
|
||||
$url = admin_url() . 'customize.php?';
|
||||
$url .= 'url=' . urlencode( site_url() . '?storefront-customizer=true' ) ;
|
||||
$url .= '&return=' . urlencode( admin_url() . 'themes.php?page=storefront-welcome' );
|
||||
$url .= '&storefront-customizer=true';
|
||||
?>
|
||||
<div class="feature-section col two-col" style="margin-bottom: 1.618em; overflow: hidden;">
|
||||
|
||||
|
@ -258,4 +258,4 @@ class storefront_welcome {
|
|||
}
|
||||
}
|
||||
|
||||
$GLOBALS['storefront_welcome'] = new storefront_welcome();
|
||||
$GLOBALS['Storefront_Welcome'] = new Storefront_Welcome();
|
|
@ -36,272 +36,270 @@ if ( ! function_exists( 'storefront_customize_register' ) ) {
|
|||
require_once dirname( __FILE__ ) . '/controls/divider.php';
|
||||
|
||||
/**
|
||||
* Add the typography section
|
||||
* Add the typography section
|
||||
*/
|
||||
$wp_customize->add_section( 'storefront_typography' , array(
|
||||
'title' => __( 'Typography', 'storefront' ),
|
||||
'priority' => 45,
|
||||
$wp_customize->add_section( 'storefront_typography' , array(
|
||||
'title' => __( 'Typography', 'storefront' ),
|
||||
'priority' => 45,
|
||||
) );
|
||||
|
||||
/**
|
||||
* Accent Color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_accent_color', array(
|
||||
'default' => apply_filters( 'storefront_default_accent_color', '#a46497' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
'default' => apply_filters( 'storefront_default_accent_color', '#a46497' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_accent_color', array(
|
||||
'label' => 'Link / accent color',
|
||||
'section' => 'storefront_typography',
|
||||
'settings' => 'storefront_accent_color',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_accent_color', array(
|
||||
'label' => 'Link / accent color',
|
||||
'section' => 'storefront_typography',
|
||||
'settings' => 'storefront_accent_color',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Text color
|
||||
/**
|
||||
* Text Color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_text_color', '#787E87' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
$wp_customize->add_setting( 'storefront_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_text_color', '#787E87' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'storefront_typography',
|
||||
'settings' => 'storefront_text_color',
|
||||
'priority' => 30,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Heading color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_heading_color', array(
|
||||
'default' => apply_filters( 'storefront_default_heading_color', '#484c51' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_heading_color', array(
|
||||
'label' => 'Heading color',
|
||||
'section' => 'storefront_typography',
|
||||
'settings' => 'storefront_heading_color',
|
||||
'priority' => 40,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Header Background
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_header_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_header_background_color', '#2c2d33' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_header_background_color', array(
|
||||
'label' => 'Background color',
|
||||
'section' => 'header_image',
|
||||
'settings' => 'storefront_header_background_color',
|
||||
'priority' => 15,
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'storefront_typography',
|
||||
'settings' => 'storefront_text_color',
|
||||
'priority' => 30,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Header text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_header_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_header_text_color', '#5a6567' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
* Heading color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_heading_color', array(
|
||||
'default' => apply_filters( 'storefront_default_heading_color', '#484c51' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_header_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'header_image',
|
||||
'settings' => 'storefront_header_text_color',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_heading_color', array(
|
||||
'label' => 'Heading color',
|
||||
'section' => 'storefront_typography',
|
||||
'settings' => 'storefront_heading_color',
|
||||
'priority' => 40,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Header link color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_header_link_color', array(
|
||||
'default' => apply_filters( 'storefront_default_header_link_color', '#ffffff' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
/**
|
||||
* Header Background
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_header_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_header_background_color', '#2c2d33' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_header_link_color', array(
|
||||
'label' => 'Link color',
|
||||
'section' => 'header_image',
|
||||
'settings' => 'storefront_header_link_color',
|
||||
'priority' => 30,
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_header_background_color', array(
|
||||
'label' => 'Background color',
|
||||
'section' => 'header_image',
|
||||
'settings' => 'storefront_header_background_color',
|
||||
'priority' => 15,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Footer section
|
||||
*/
|
||||
$wp_customize->add_section( 'storefront_footer' , array(
|
||||
'title' => __( 'Footer', 'storefront' ),
|
||||
'priority' => 40,
|
||||
'description' => __( 'Customise the look & feel of your web site footer.', 'storefront' ),
|
||||
/**
|
||||
* Header text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_header_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_header_text_color', '#5a6567' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_header_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'header_image',
|
||||
'settings' => 'storefront_header_text_color',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Header link color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_header_link_color', array(
|
||||
'default' => apply_filters( 'storefront_default_header_link_color', '#ffffff' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_header_link_color', array(
|
||||
'label' => 'Link color',
|
||||
'section' => 'header_image',
|
||||
'settings' => 'storefront_header_link_color',
|
||||
'priority' => 30,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Footer section
|
||||
*/
|
||||
$wp_customize->add_section( 'storefront_footer' , array(
|
||||
'title' => __( 'Footer', 'storefront' ),
|
||||
'priority' => 40,
|
||||
'description' => __( 'Customise the look & feel of your web site footer.', 'storefront' ),
|
||||
) );
|
||||
|
||||
/**
|
||||
* Footer heading color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_heading_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_heading_color', '#646c6e' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
* Footer heading color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_heading_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_heading_color', '#646c6e' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_heading_color', array(
|
||||
'label' => 'Heading color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_heading_color',
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_heading_color', array(
|
||||
'label' => 'Heading color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_heading_color',
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Footer text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_text_color', '#abb1ba' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
* Footer text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_text_color', '#abb1ba' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_text_color',
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_text_color',
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Footer link color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_link_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_link_color', '#a46497' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
/**
|
||||
* Footer link color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_link_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_link_color', '#a46497' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_link_color', array(
|
||||
'label' => 'Link color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_link_color',
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_link_color', array(
|
||||
'label' => 'Link color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_link_color',
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Footer Background
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_background_color', '#f3f3f3' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
/**
|
||||
* Footer Background
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_footer_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_footer_background_color', '#f3f3f3' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
'transport' => 'postMessage',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_background_color', array(
|
||||
'label' => 'Background color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_background_color',
|
||||
) ) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_footer_background_color', array(
|
||||
'label' => 'Background color',
|
||||
'section' => 'storefront_footer',
|
||||
'settings' => 'storefront_footer_background_color',
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Buttons section
|
||||
*/
|
||||
$wp_customize->add_section( 'storefront_buttons' , array(
|
||||
'title' => __( 'Buttons', 'storefront' ),
|
||||
'priority' => 45,
|
||||
'description' => __( 'Customise the look & feel of your web site buttons.', 'storefront' ),
|
||||
/**
|
||||
* Buttons section
|
||||
*/
|
||||
$wp_customize->add_section( 'storefront_buttons' , array(
|
||||
'title' => __( 'Buttons', 'storefront' ),
|
||||
'priority' => 45,
|
||||
'description' => __( 'Customise the look & feel of your web site buttons.', 'storefront' ),
|
||||
) );
|
||||
|
||||
/**
|
||||
* Button background color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_background_color', '#787E87' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_background_color', array(
|
||||
'label' => 'Background color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_background_color',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Button text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_text_color', '#ffffff' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_text_color',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Button alt background color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_alt_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_alt_background_color', '#a46497' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_alt_background_color', array(
|
||||
'label' => 'Alternate button background color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_alt_background_color',
|
||||
'priority' => 30,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Button alt text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_alt_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_alt_text_color', '#ffffff' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_alt_text_color', array(
|
||||
'label' => 'Alternate button text color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_alt_text_color',
|
||||
'priority' => 40,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Layout
|
||||
*/
|
||||
$wp_customize->add_section( 'storefront_layout' , array(
|
||||
'title' => __( 'Layout', 'storefront' ),
|
||||
'priority' => 50,
|
||||
* Button background color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_background_color', '#787E87' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_setting( 'storefront_layout', array(
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'storefront_sanitize_layout',
|
||||
) );
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_background_color', array(
|
||||
'label' => 'Background color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_background_color',
|
||||
'priority' => 10,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_control( new Layout_Picker_Storefront_Control( $wp_customize, 'storefront_layout', array(
|
||||
'label' => __( 'General layout', 'storefront' ),
|
||||
'section' => 'storefront_layout',
|
||||
'settings' => 'storefront_layout',
|
||||
'priority' => 1,
|
||||
)
|
||||
/**
|
||||
* Button text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_text_color', '#ffffff' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_text_color', array(
|
||||
'label' => 'Text color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_text_color',
|
||||
'priority' => 20,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Button alt background color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_alt_background_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_alt_background_color', '#a46497' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_alt_background_color', array(
|
||||
'label' => 'Alternate button background color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_alt_background_color',
|
||||
'priority' => 30,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Button alt text color
|
||||
*/
|
||||
$wp_customize->add_setting( 'storefront_button_alt_text_color', array(
|
||||
'default' => apply_filters( 'storefront_default_button_alt_text_color', '#ffffff' ),
|
||||
'sanitize_callback' => 'storefront_sanitize_hex_color',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'storefront_button_alt_text_color', array(
|
||||
'label' => 'Alternate button text color',
|
||||
'section' => 'storefront_buttons',
|
||||
'settings' => 'storefront_button_alt_text_color',
|
||||
'priority' => 40,
|
||||
) ) );
|
||||
|
||||
/**
|
||||
* Layout
|
||||
*/
|
||||
$wp_customize->add_section( 'storefront_layout' , array(
|
||||
'title' => __( 'Layout', 'storefront' ),
|
||||
'priority' => 50,
|
||||
) );
|
||||
|
||||
$wp_customize->add_setting( 'storefront_layout', array(
|
||||
'default' => 'right',
|
||||
'sanitize_callback' => 'storefront_sanitize_layout',
|
||||
) );
|
||||
|
||||
$wp_customize->add_control( new Layout_Picker_Storefront_Control( $wp_customize, 'storefront_layout', array(
|
||||
'label' => __( 'General layout', 'storefront' ),
|
||||
'section' => 'storefront_layout',
|
||||
'settings' => 'storefront_layout',
|
||||
'priority' => 1,
|
||||
) ) );
|
||||
|
||||
$wp_customize->add_control( new Divider_Storefront_Control( $wp_customize, 'storefront_layout_divider', array(
|
||||
'section' => 'storefront_layout',
|
||||
'settings' => 'storefront_layout',
|
||||
'priority' => 2,
|
||||
)
|
||||
) );
|
||||
'section' => 'storefront_layout',
|
||||
'settings' => 'storefront_layout',
|
||||
'priority' => 2,
|
||||
) ) );
|
||||
}
|
||||
}
|
|
@ -46,10 +46,10 @@ if ( ! function_exists( 'storefront_sanitize_hex_color' ) ) {
|
|||
*/
|
||||
if ( ! function_exists( 'storefront_sanitize_layout' ) ) {
|
||||
function storefront_sanitize_layout( $input ) {
|
||||
$valid = array(
|
||||
'right' => 'Right',
|
||||
'left' => 'Left',
|
||||
);
|
||||
$valid = array(
|
||||
'right' => 'Right',
|
||||
'left' => 'Left',
|
||||
);
|
||||
|
||||
if ( array_key_exists( $input, $valid ) ) {
|
||||
return $input;
|
||||
|
@ -88,27 +88,27 @@ function storefront_layout_class( $classes ) {
|
|||
*/
|
||||
function storefront_adjust_color_brightness( $hex, $steps ) {
|
||||
// Steps should be between -255 and 255. Negative = darker, positive = lighter
|
||||
$steps = max( -255, min( 255, $steps ) );
|
||||
$steps = max( -255, min( 255, $steps ) );
|
||||
|
||||
// Format the hex color string
|
||||
$hex = str_replace( '#', '', $hex );
|
||||
$hex = str_replace( '#', '', $hex );
|
||||
if ( strlen( $hex ) == 3 ) {
|
||||
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
|
||||
$hex = str_repeat( substr( $hex, 0, 1 ), 2 ) . str_repeat( substr( $hex, 1, 1 ), 2 ) . str_repeat( substr( $hex, 2, 1 ), 2 );
|
||||
}
|
||||
|
||||
// Get decimal values
|
||||
$r = hexdec( substr( $hex, 0, 2 ) );
|
||||
$g = hexdec( substr( $hex, 2, 2 ) );
|
||||
$b = hexdec( substr( $hex, 4, 2 ) );
|
||||
$r = hexdec( substr( $hex, 0, 2 ) );
|
||||
$g = hexdec( substr( $hex, 2, 2 ) );
|
||||
$b = hexdec( substr( $hex, 4, 2 ) );
|
||||
|
||||
// Adjust number of steps and keep it inside 0 to 255
|
||||
$r = max( 0, min( 255, $r + $steps ) );
|
||||
$g = max( 0, min( 255, $g + $steps ) );
|
||||
$b = max( 0, min( 255, $b + $steps ) );
|
||||
$r = max( 0, min( 255, $r + $steps ) );
|
||||
$g = max( 0, min( 255, $g + $steps ) );
|
||||
$b = max( 0, min( 255, $b + $steps ) );
|
||||
|
||||
$r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );
|
||||
$g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );
|
||||
$b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );
|
||||
$r_hex = str_pad( dechex( $r ), 2, '0', STR_PAD_LEFT );
|
||||
$g_hex = str_pad( dechex( $g ), 2, '0', STR_PAD_LEFT );
|
||||
$b_hex = str_pad( dechex( $b ), 2, '0', STR_PAD_LEFT );
|
||||
|
||||
return '#' . $r_hex . $g_hex . $b_hex;
|
||||
}
|
|
@ -76,25 +76,25 @@ if ( ! function_exists( 'is_woocommerce_activated' ) ) {
|
|||
* @return string schema itemprop type
|
||||
*/
|
||||
function storefront_html_tag_schema() {
|
||||
$schema = 'http://schema.org/';
|
||||
$type = 'WebPage';
|
||||
$schema = 'http://schema.org/';
|
||||
$type = 'WebPage';
|
||||
|
||||
// Is single post
|
||||
if ( is_singular( 'post' ) ) {
|
||||
$type = "Article";
|
||||
}
|
||||
// Is single post
|
||||
if ( is_singular( 'post' ) ) {
|
||||
$type = 'Article';
|
||||
}
|
||||
|
||||
// Is author page
|
||||
elseif ( is_author() ) {
|
||||
$type = 'ProfilePage';
|
||||
}
|
||||
// Is author page
|
||||
elseif ( is_author() ) {
|
||||
$type = 'ProfilePage';
|
||||
}
|
||||
|
||||
// Is search results page
|
||||
elseif ( is_search() ) {
|
||||
$type = 'SearchResultsPage';
|
||||
}
|
||||
// Is search results page
|
||||
elseif ( is_search() ) {
|
||||
$type = 'SearchResultsPage';
|
||||
}
|
||||
|
||||
echo 'itemscope="itemscope" itemtype="' . esc_attr( $schema ) . esc_attr( $type ) . '"';
|
||||
echo 'itemscope="itemscope" itemtype="' . esc_attr( $schema ) . esc_attr( $type ) . '"';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,73 +19,73 @@ $theme = wp_get_theme();
|
|||
$storefront_version = $theme['Version'];
|
||||
|
||||
if ( ! function_exists( 'storefront_setup' ) ) :
|
||||
/**
|
||||
* Sets up theme defaults and registers support for various WordPress features.
|
||||
*
|
||||
* Note that this function is hooked into the after_setup_theme hook, which
|
||||
* runs before the init hook. The init hook is too late for some features, such
|
||||
* as indicating support for post thumbnails.
|
||||
*/
|
||||
function storefront_setup() {
|
||||
|
||||
/*
|
||||
* Load Localisation files.
|
||||
*
|
||||
* Note: the first-loaded translation file overrides any following ones if the same translation is present.
|
||||
*/
|
||||
|
||||
// wp-content/languages/theme-name/it_IT.mo
|
||||
load_theme_textdomain( 'storefront', trailingslashit( WP_LANG_DIR ) . 'themes/' );
|
||||
|
||||
// wp-content/themes/child-theme-name/languages/it_IT.mo
|
||||
load_theme_textdomain( 'storefront', get_stylesheet_directory() . '/languages' );
|
||||
|
||||
// wp-content/themes/theme-name/languages/it_IT.mo
|
||||
load_theme_textdomain( 'storefront', get_template_directory() . '/languages' );
|
||||
|
||||
/**
|
||||
* Add default posts and comments RSS feed links to head.
|
||||
*/
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
|
||||
/*
|
||||
* Enable support for Post Thumbnails on posts and pages.
|
||||
* Sets up theme defaults and registers support for various WordPress features.
|
||||
*
|
||||
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
|
||||
* Note that this function is hooked into the after_setup_theme hook, which
|
||||
* runs before the init hook. The init hook is too late for some features, such
|
||||
* as indicating support for post thumbnails.
|
||||
*/
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
function storefront_setup() {
|
||||
|
||||
// This theme uses wp_nav_menu() in two locations.
|
||||
register_nav_menus( array(
|
||||
'primary' => __( 'Primary Menu', 'storefront' ),
|
||||
'secondary' => __( 'Secondary Menu', 'storefront' ),
|
||||
) );
|
||||
/*
|
||||
* Load Localisation files.
|
||||
*
|
||||
* Note: the first-loaded translation file overrides any following ones if the same translation is present.
|
||||
*/
|
||||
|
||||
/*
|
||||
* 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',
|
||||
) );
|
||||
// wp-content/languages/theme-name/it_IT.mo
|
||||
load_theme_textdomain( 'storefront', trailingslashit( WP_LANG_DIR ) . 'themes/' );
|
||||
|
||||
// Setup the WordPress core custom background feature.
|
||||
add_theme_support( 'custom-background', apply_filters( 'storefront_custom_background_args', array(
|
||||
'default-color' => apply_filters( 'storefront_default_background_color', 'fcfcfc' ),
|
||||
'default-image' => '',
|
||||
) ) );
|
||||
// wp-content/themes/child-theme-name/languages/it_IT.mo
|
||||
load_theme_textdomain( 'storefront', get_stylesheet_directory() . '/languages' );
|
||||
|
||||
// Add support for the Site Logo plugin and the site logo functionality in JetPack
|
||||
// https://github.com/automattic/site-logo
|
||||
// http://jetpack.me/
|
||||
add_theme_support( 'site-logo', array( 'size' => 'full' ) );
|
||||
// wp-content/themes/theme-name/languages/it_IT.mo
|
||||
load_theme_textdomain( 'storefront', get_template_directory() . '/languages' );
|
||||
|
||||
// Declare WooCommerce support
|
||||
add_theme_support( 'woocommerce' );
|
||||
/**
|
||||
* Add default posts and comments RSS feed links to head.
|
||||
*/
|
||||
add_theme_support( 'automatic-feed-links' );
|
||||
|
||||
// Declare support for title theme feature
|
||||
add_theme_support( 'title-tag' );
|
||||
}
|
||||
/*
|
||||
* Enable support for Post Thumbnails on posts and pages.
|
||||
*
|
||||
* @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails
|
||||
*/
|
||||
add_theme_support( 'post-thumbnails' );
|
||||
|
||||
// This theme uses wp_nav_menu() in two locations.
|
||||
register_nav_menus( array(
|
||||
'primary' => __( 'Primary Menu', 'storefront' ),
|
||||
'secondary' => __( 'Secondary Menu', 'storefront' ),
|
||||
) );
|
||||
|
||||
/*
|
||||
* 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',
|
||||
) );
|
||||
|
||||
// Setup the WordPress core custom background feature.
|
||||
add_theme_support( 'custom-background', apply_filters( 'storefront_custom_background_args', array(
|
||||
'default-color' => apply_filters( 'storefront_default_background_color', 'fcfcfc' ),
|
||||
'default-image' => '',
|
||||
) ) );
|
||||
|
||||
// Add support for the Site Logo plugin and the site logo functionality in JetPack
|
||||
// https://github.com/automattic/site-logo
|
||||
// http://jetpack.me/
|
||||
add_theme_support( 'site-logo', array( 'size' => 'full' ) );
|
||||
|
||||
// Declare WooCommerce support
|
||||
add_theme_support( 'woocommerce' );
|
||||
|
||||
// Declare support for title theme feature
|
||||
add_theme_support( 'title-tag' );
|
||||
}
|
||||
endif; // storefront_setup
|
||||
|
||||
/**
|
||||
|
|
|
@ -34,7 +34,7 @@ if ( ! function_exists( 'storefront_comment' ) ) {
|
|||
$tag = 'li';
|
||||
$add_below = 'div-comment';
|
||||
}
|
||||
?>
|
||||
?>
|
||||
<<?php echo esc_attr( $tag ); ?> <?php comment_class( empty( $args['has_children'] ) ? '' : 'parent' ) ?> id="comment-<?php comment_ID() ?>">
|
||||
<div class="comment-body">
|
||||
<div class="comment-meta commentmetadata">
|
||||
|
|
|
@ -61,8 +61,7 @@ if ( ! function_exists( 'storefront_site_branding' ) ) {
|
|||
function storefront_site_branding() {
|
||||
if ( function_exists( 'jetpack_has_site_logo' ) && jetpack_has_site_logo() ) {
|
||||
jetpack_the_site_logo();
|
||||
} else {
|
||||
?>
|
||||
} else { ?>
|
||||
<div class="site-branding">
|
||||
<h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>
|
||||
<p class="site-description"><?php bloginfo( 'description' ); ?></p>
|
||||
|
|
|
@ -13,7 +13,8 @@ if ( ! function_exists( 'storefront_post_header' ) ) {
|
|||
function storefront_post_header() {
|
||||
?>
|
||||
<header class="entry-header">
|
||||
<?php if ( is_single() ) {
|
||||
<?php
|
||||
if ( is_single() ) {
|
||||
storefront_posted_on();
|
||||
the_title( '<h1 class="entry-title" itemprop="name headline">', '</h1>' );
|
||||
} else {
|
||||
|
@ -22,7 +23,8 @@ if ( ! function_exists( 'storefront_post_header' ) ) {
|
|||
}
|
||||
|
||||
the_title( sprintf( '<h1 class="entry-title" itemprop="name headline"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' );
|
||||
} ?>
|
||||
}
|
||||
?>
|
||||
</header><!-- .entry-header -->
|
||||
<?php
|
||||
}
|
||||
|
@ -37,9 +39,9 @@ if ( ! function_exists( 'storefront_post_content' ) ) {
|
|||
?>
|
||||
<div class="entry-content" itemprop="articleBody">
|
||||
<?php
|
||||
if ( has_post_thumbnail() ) {
|
||||
the_post_thumbnail( 'full', array( 'itemprop' => 'image' ) );
|
||||
}
|
||||
if ( has_post_thumbnail() ) {
|
||||
the_post_thumbnail( 'full', array( 'itemprop' => 'image' ) );
|
||||
}
|
||||
?>
|
||||
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'storefront' ) ); ?>
|
||||
<?php
|
||||
|
@ -63,24 +65,24 @@ if ( ! function_exists( 'storefront_post_meta' ) ) {
|
|||
<aside class="entry-meta">
|
||||
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
|
||||
<?php
|
||||
/* translators: used between list items, there is a space after the comma */
|
||||
$categories_list = get_the_category_list( __( ', ', 'storefront' ) );
|
||||
if ( $categories_list && storefront_categorized_blog() ) :
|
||||
?>
|
||||
<span class="cat-links"><?php echo esc_attr( $categories_list ); ?></span>
|
||||
/* translators: used between list items, there is a space after the comma */
|
||||
$categories_list = get_the_category_list( __( ', ', 'storefront' ) );
|
||||
|
||||
if ( $categories_list && storefront_categorized_blog() ) : ?>
|
||||
<span class="cat-links"><?php echo esc_attr( $categories_list ); ?></span>
|
||||
<?php endif; // End if categories ?>
|
||||
|
||||
<?php
|
||||
/* translators: used between list items, there is a space after the comma */
|
||||
$tags_list = get_the_tag_list( '', __( ', ', 'storefront' ) );
|
||||
if ( $tags_list ) :
|
||||
?>
|
||||
<span class="tags-links"><?php echo esc_attr( $tags_list ); ?></span>
|
||||
/* translators: used between list items, there is a space after the comma */
|
||||
$tags_list = get_the_tag_list( '', __( ', ', 'storefront' ) );
|
||||
|
||||
if ( $tags_list ) : ?>
|
||||
<span class="tags-links"><?php echo esc_attr( $tags_list ); ?></span>
|
||||
<?php endif; // End if $tags_list ?>
|
||||
<?php endif; // End if 'post' == get_post_type() ?>
|
||||
|
||||
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
|
||||
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'storefront' ), __( '1 Comment', 'storefront' ), __( '% Comments', 'storefront' ) ); ?></span>
|
||||
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'storefront' ), __( '1 Comment', 'storefront' ), __( '% Comments', 'storefront' ) ); ?></span>
|
||||
<?php endif; ?>
|
||||
</aside>
|
||||
<?php
|
||||
|
@ -160,7 +162,7 @@ if ( ! function_exists( 'storefront_posted_on' ) ) {
|
|||
|
||||
$posted_on = sprintf(
|
||||
_x( 'Posted on %s', 'post date', 'storefront' ),
|
||||
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . esc_attr( $time_string ) . '</a>'
|
||||
'<a href="' . esc_url( get_permalink() ) . '" rel="bookmark">' . $time_string . '</a>'
|
||||
);
|
||||
|
||||
$byline = sprintf(
|
||||
|
@ -168,7 +170,7 @@ if ( ! function_exists( 'storefront_posted_on' ) ) {
|
|||
'<span class="author vcard" itemprop="author" itemscope="" itemtype="http://schema.org/Person"><a class="url fn n" itemprop="name" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a></span>'
|
||||
);
|
||||
|
||||
echo '<span class="posted-on">' . esc_attry( $posted_on ) . '</span><span class="byline"> ' . esc_attry( $byline ) . '</span>';
|
||||
echo '<span class="posted-on">' . $posted_on . '</span><span class="byline"> ' . $byline . '</span>';
|
||||
|
||||
}
|
||||
}
|
|
@ -15,9 +15,9 @@
|
|||
if ( ! function_exists( 'storefront_cart_link' ) ) {
|
||||
function storefront_cart_link() {
|
||||
if ( is_cart() ) {
|
||||
$class = "current-menu-item";
|
||||
$class = 'current-menu-item';
|
||||
} else {
|
||||
$class = "";
|
||||
$class = '';
|
||||
}
|
||||
?>
|
||||
<li class="<?php echo esc_attr( $class ); ?>">
|
||||
|
@ -69,6 +69,6 @@ function storefront_header_cart() {
|
|||
*/
|
||||
if ( ! function_exists( 'storefront_upsell_display' ) ) {
|
||||
function storefront_upsell_display() {
|
||||
woocommerce_upsell_display( -1, 3 );
|
||||
woocommerce_upsell_display( -1, 3 );
|
||||
}
|
||||
}
|
10
loop.php
10
loop.php
|
@ -13,11 +13,11 @@ do_action( 'storefront_loop_before' );
|
|||
while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php
|
||||
/* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'content', get_post_format() );
|
||||
/* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'content', get_post_format() );
|
||||
?>
|
||||
|
||||
<?php endwhile;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue