<?php if( ! defined( 'ABSPATH' ) ) exit;
/**
 * Read More Button
 */
	function faster_excerpt_more( $more ) {
		if ( is_admin() ) {
			return $more;
		}
        return '<p class="link-more"><a class="myButt " href="'. esc_url(get_permalink( get_the_ID() ) ) . '">' . faster_return_read_more_text (). '</a></p>';
	}
	add_filter( 'excerpt_more', 'faster_excerpt_more' );	
	function faster_excerpt_length( $length ) {
			if ( is_admin() ) {
					return $length;
			}
			return 42;
	}
	add_filter( 'excerpt_length', 'faster_excerpt_length', 999 );
	function faster_return_read_more_text () {
		if( get_theme_mod( 'faster_read_more_text' ) ) {
			return esc_html( get_theme_mod( 'faster_read_more_text' ) );
		} else {
	    	return __( 'Read More','faster');
		}
	}
add_action( 'customize_register', 'faster_read_more_customize_register' );
function faster_read_more_customize_register( $wp_customize ) {
/***********************************************************************************
 * Back to top button Options
***********************************************************************************/
		$wp_customize->add_section( 'faster_read_more' , array(
			'title'       => __( 'Read More Button', 'faster' ),
			'priority'   => 34,
		) );
		$wp_customize->add_setting( 'faster_read_more_text', array (
			'sanitize_callback' => 'sanitize_text_field',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'faster_read_more_text', array(
			'priority'    => 1,
			'label'    => __( 'Read More Text', 'faster' ),
			'section'  => 'faster_read_more',
			'settings' => 'faster_read_more_text',
			'type' => 'text',
		) ) );
		$wp_customize->add_setting( 'hide_read_more', array (
            'default' => '',		
			'sanitize_callback' => 'faster_sanitize_checkbox',
		) );
		$wp_customize->add_control( new WP_Customize_Control( $wp_customize, 'hide_read_more', array(
			'label'    => __( 'Activate all content and remove read more button on the blog page.', 'faster' ),
			'section'  => 'faster_read_more',
			'priority'    => 3,				
			'settings' => 'hide_read_more',
			'type' => 'checkbox',
		) ) );
}