Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #20829
    Websiteguy
    Member

    Hi

    How can I enable zooming in my child theme?

    To enable it you put the code <meta name="viewport" content="width=device-width, initial-scale=1" /> and you put it in your header.php. I won’t to add it to a plugin or the functions.php.

    I tried this.

    function zoom_site() {
    		 echo '<meta name="viewport" content="width=device-width, initial-scale=1" />';
    }
    add_action('wp_head', 'zoom_site', 1);

    But it didn’t work.

    Any suggestions would be much appreciated.
    Thanks

    #20844
    Sakin
    Keymaster

    @Websiteguy: just add the following code in your child theme functions.php file.

    // Removing the Default Slider
    function unhook_catcheverest_functions() {
    	remove_action( 'wp_head', 'catcheverest_responsive', 5 );
    }
    add_action( 'init', 'unhook_catcheverest_functions' );
    
    //Responsive Meta in Child Theme 
    function catcheverest_child_responsive() {
    	// Getting data from Theme Options
    	global $catcheverest_options_settings;
       	$options = $catcheverest_options_settings;
    	$disable_responsive = $options[ 'disable_responsive' ];
    	
    	if ( $disable_responsive == "0" ) {	
    		echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
    	}
    }
    add_action( 'wp_head', 'catcheverest_child_responsive', 5 );
    #20857
    Websiteguy
    Member

    Will this work on any theme?

    #20868
    Sakin
    Keymaster

    @Websiteguy: That is for Catch Everest Theme and every theme will have different code.

    #31148
    Websiteguy
    Member

    I solved this without a code. I just put the <meta name=”viewport” content=”width=device-width, initial-scale=1″ /> code in the settings webmaster tool > Code to display in Header.

    #31152
    Sakin
    Keymaster

    @Websiteguy: That’s nice and clever work. Cheers 🙂

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Enable Zooming in Child Theme’ is closed to new replies.