This topic has 6 replies, 2 voices, and was last updated 9 years by grafityx.

  • Author
  • #51930
     grafityx
    Participant

    Dear, I would like to know how to disable the responsive mode on a specific page ?
    I have a page with a script installed that appears fine on a computer but not on small devices …

    Thanks

    #52266
     Andrei
    Moderator

    Hi, unfortunately there’s no such out of the box option, you should probably edit the header template, and apply the viewport only in specific cases. Please not that you’ll need programming skills to do that.

    Let me know if I can help you with anything else.
    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #52273
     grafityx
    Participant

    What about if i make a custom page template for the specific page ? What i need to delete or add to disable the responsive function ?

    Thanks

    #52275
     Andrei
    Moderator

    The responsiveness of a page starts from the detection of the device width, which is called “viewport”. This viewport meta tag can be found in the head section of the header, and you’ll have to make some checks in the header and disable/enable the meta tag just for some pages.

    Let me know if I can help you with anything else.
    Cheers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #52359
     grafityx
    Participant

    I added this into the header file and it works very well ! Is there a better way to write it?

    Thanks

    COPY CODE
    <?php
    if ( is_page('inscricao')) {
    echo '<meta name="viewport" content="width=980" />';
    }
    ?> 
    COPY CODE
    <?php
    /**
     * The Header for our theme.
     *
     * @package WordPress
     * @subpackage Sweetdate
     * @author SeventhQueen <themesupport@seventhqueen.com>
     * @since Sweetdate 1.0
     */
    ?><!DOCTYPE html>
    
    <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" <?php language_attributes(); ?>> <![endif]-->
    <!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" <?php language_attributes(); ?>> <![endif]-->
    <!--[if IE 8]>    <html class="no-js lt-ie9" <?php language_attributes(); ?>> <![endif]-->
    <!--[if gt IE 8]><!-->
    
    <html class="no-js" <?php language_attributes(); ?>>
    <!--<![endif]-->
    
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    <meta name="viewport" content="width=device-width" />
    <?php
    if ( is_page('inscricao')) {
    echo '<meta name="viewport" content="width=980" />';
    }
    ?> 
    <title><?php wp_title( '|', true, 'right' ); ?></title>
    
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    #52375
     Andrei
    Moderator

    It’s better like this:

    COPY CODE
    
    <?php
    /**
    * The Header for our theme.
    *
    * @package WordPress
    * @subpackage Sweetdate
    * @author SeventhQueen <themesupport@seventhqueen.com>
    * @since Sweetdate 1.0
    */
    ?><!DOCTYPE html>
     
    <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" <?php language_attributes(); ?>> <![endif]-->
    <!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" <?php language_attributes(); ?>> <![endif]-->
    <!--[if IE 8]>    <html class="no-js lt-ie9" <?php language_attributes(); ?>> <![endif]-->
    <!--[if gt IE 8]><!-->
     
    <html class="no-js" <?php language_attributes(); ?>>
    <!--<![endif]-->
     
    <head>
    <meta charset="<?php bloginfo( 'charset' ); ?>" />
    
    <?php
    if ( is_page('inscricao')) {
    echo '<meta name="viewport" content="width=980" />';
    }else{
    echo '<meta name="viewport" content="width=device-width" />';
    }
    ?>
    
    <title><?php wp_title( '|', true, 'right' ); ?></title>
     
    <link rel="profile" href="http://gmpg.org/xfn/11" />
    <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #52377
     grafityx
    Participant

    Thanks 🙂

Viewing 7 posts - 1 through 7 (of 7 total)

The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?