'Sidebar', 'id' => 'sidebar-1', 'description' => __( 'Widgets in this area will be shown on the bottom side.', 'patria' ), 'before_widget' => '
', 'before_title' => '
]*?href=[\'"](.+?)[\'"]/i', get_the_content(), $links ) ){ return false; } return esc_url_raw( $links[1] ); } /* * 6. Custom comments */ function patria_format_comment($comment, $args, $depth) { $single['comment'] = $comment; ?>
' . ( "Pages:" ), 'after' => '
', 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'separator' => ' ', 'nextpagelink' => __('Next page', 'patria'), 'previouspagelink' => __('Previous page', 'patria'), 'pagelink' => '%', 'echo' => 1 ) ); // Comment reply in singular if ( is_singular() ) wp_enqueue_script( "comment-reply" ); // Defined content width if ( ! isset( $content_width ) ) $content_width = 1000; /* * 8. Customize */ //////////////////// // Menu //////////////////// add_action( 'customize_register', 'patria_menu_type' ); function patria_menu_type( $wp_customize ){ $wp_customize->add_section( 'patria_menu_type_section', array( 'title' => __( 'The method of displaying the menu', 'patria' ), 'priority' => 30 )); $wp_customize->add_setting( 'menu_type', array( 'default' => '1', 'transport' => 'refresh', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'menu_type', array( 'label' => __( 'Choose one of the three methods of displaying the menu.', 'patria' ), 'description' => __( 'Each of the three methods of displaying the menu is fully responsive.', 'patria' ), 'section' => 'patria_menu_type_section', 'settings' => 'menu_type', 'type' => 'radio', 'choices' => array( '1' => __( '1) The menu is extended to the entire width of the page.', 'patria' ), '2' => __( '2) The menu has a predetermined width.', 'patria' ), '3' => __( '3) The menu has a certain width, and whole page is preceded by a distance from the top of the page.', 'patria' ) ) ))); } //////////////////// // Social icons //////////////////// add_action('customize_register','patria_social_icons'); function patria_social_icons( $wp_customize ) { // Add section $wp_customize->add_section( 'patria_social_icons_section', array( 'title' => __( 'Social icons in footer of the page', 'patria' ), 'description' => __( 'To add a link to a social networking site place the link to your profile in the field reserved for the appropriate service. If you do not want to some icon appeared there, do not complement the field, however, if the icon displayed itself, check whether the field does not contain spaces or tabs.', 'patria' ), 'priority' => 20 )); // Facebook $wp_customize->add_setting( 'patria_facebook', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_facebook', array( 'label' => 'Facebook URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_facebook' ))); // Twitter $wp_customize->add_setting( 'patria_twitter', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_twitter', array( 'label' => 'Twitter URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_twitter' ))); // Google $wp_customize->add_setting( 'patria_google', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_google', array( 'label' => 'Google Plus URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_google' ))); // LinkedIn $wp_customize->add_setting( 'patria_linkedin', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_linkedin', array( 'label' => 'LinkedIn URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_linkedin' ))); // YouTube $wp_customize->add_setting( 'patria_youtube', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_youtube', array( 'label' => 'YouTube URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_youtube' ))); // Pinterest $wp_customize->add_setting( 'patria_pinterest', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_pinterest', array( 'label' => 'Pinterest URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_pinterest' ))); // GitHub $wp_customize->add_setting( 'patria_github', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_github', array( 'label' => 'GitHub URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_github' ))); // Vimeo $wp_customize->add_setting( 'patria_vimeo', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_vimeo', array( 'label' => 'Vimeo URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_vimeo' ))); // Vimeo $wp_customize->add_setting( 'patria_vimeo', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_vimeo', array( 'label' => 'Vimeo URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_vimeo' ))); // Flickr $wp_customize->add_setting( 'patria_flickr', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_flickr', array( 'label' => 'Flickr URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_flickr' ))); // SoundCloud $wp_customize->add_setting( 'patria_soundcloud', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_soundcloud', array( 'label' => 'SoundCloud URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_soundcloud' ))); // Twitch $wp_customize->add_setting( 'patria_twitch', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_twitch', array( 'label' => 'Twitch URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_twitch' ))); // Tumblr $wp_customize->add_setting( 'patria_tumblr', array( 'default' => '', 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'patria_tumblr', array( 'label' => 'Tumblr URL', 'section' => 'patria_social_icons_section', 'settings' => 'patria_tumblr' ))); } //////////////////// // Author box //////////////////// add_action( 'customize_register', 'patria_author' ); function patria_author( $wp_customize ){ // Add section $wp_customize->add_section( 'patria_author_section', array( 'title' => __( 'Information about author ', 'patria' ), 'description' => __( 'Option to enable / disable the displaying of information about the author of the posts/pages.', 'patria' ), 'priority' => 20 )); // Author box in post $wp_customize->add_setting( 'author_post', array( 'default' => true, 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'author_post', array( 'label' => __( 'Display in posts:', 'patria' ), 'section' => 'patria_author_section', 'settings' => 'author_post', 'type' => 'radio', 'choices' => array( true => __( 'Yes', 'patria' ), false => __( 'No', 'patria' ) ) ))); // Author box in page $wp_customize->add_setting( 'author_page', array( 'default' => false, 'sanitize_callback' => 'esc_attr', )); $wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'author_page', array( 'label' => __( 'Display in pages:', 'patria' ), 'section' => 'patria_author_section', 'settings' => 'author_page', 'type' => 'radio', 'choices' => array( true => __( 'Yes', 'patria' ), false => __( 'No', 'patria' ) ) ))); } ?>