Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Kybernetik Services

    (@kybernetikservices)

    At the moment I do not know another option at Flatsome than to just add the meta for the viewport.

    I refer to https://www.ads-software.com/support/topic/1-line-of-code/

    Thread Starter bramvds

    (@bramvds)

    Yes, but does your plugin replace or just add the line of code?
    Flatsome tells me better use your plugin instead of putting that 1 line in the header script. That would only make sense if your plugin replaces?

    Thanks

    Plugin Author Kybernetik Services

    (@kybernetikservices)

    If there is no option to modify the viewport by an action or filter (like I do with the Ocean WP theme), I can just add the viewort at the very last end of the meta section. I don’t know a way to replace the existing meta at the Faltsome theme. So, it is an additional meta.

    Thread Starter bramvds

    (@bramvds)

    Ok, so to be clear. For flatsome theme it has no use installing your plugin, because it does not modify the viewport?
    If so, how can it be that your plugin does work when installing on flatsome theme? Or does it just add an additional viewport?

    Thanks

    • This reply was modified 2 years, 11 months ago by bramvds.
    Plugin Author Kybernetik Services

    (@kybernetikservices)

    Just install the plugin and try it by your own, please.

    Thread Starter bramvds

    (@bramvds)

    yes i tried the plugin and it works. But i need to know if it then replaces the viewport or just adds a viewport.

    Plugin Author Kybernetik Services

    (@kybernetikservices)

    Please check my previous answer or the source code.

    Thread Starter bramvds

    (@bramvds)

    So it just adds a second viewport. So you have any idea why flatsome tell me better to install your plugin instead of just adding the line of code in the header script?
    Flatsome tell me your plugin replaces code which is better than adding, but you tell me for flatsome theme it just adds a code?

    Sorry for the trouble.

    Plugin Author Martin Stehle

    (@hinjiriyo)

    Both Kybernetic and flatsome are right. This plugin adds a code line for the viewport meta. That is what you can see in the HTML code. It does not “add a second viewport” since the added line replaced the former viewport meta. That is what you can not see since that happens in the browser memory (to be more excact: in the DOM).
    Alternative explanation in other words: the viewport meta before that added line becomes overwritten by the following (added) line. That is why that plugin works.
    I hope to have brought some clarity.

    Thread Starter bramvds

    (@bramvds)

    @hinjiriyo
    Thanks but still not 100% clear.
    Why would this plugin be better when using flatsome instead of just adding the code here:
    https://snipboard.io/yvCYI0.jpg
    seems to me this way it also replaces/overwrites the initial viewport.
    As i have done on this site https://www.fightplaza.nl/
    Or am I missing something? Just always want the best solution.

    Thanks.

    Plugin Author Martin Stehle

    (@hinjiriyo)

    First of all: that plugin just needs a single click to activate it. Then you can forget it. That saves time.

    Second: the plugin provides more informations in the viewport meta tag than your code. Enabled zooming is more probable. Compare both:
    your code
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    vs. the plugin’s code
    <meta name="viewport" content="width=device-width, user-scalable=yes, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0">
    You can find useful informations about that tag here.

    Third: if you switch to another theme, then your code is no more printed out. The plugin on the other side is still in effect after every theme switch.

    Thread Starter bramvds

    (@bramvds)

    @hinjiriyo
    This is not my code as you can see, you are looking at the initial viewport.
    When i add my line of code in the header script or i activate your plugin, it both adds a second viewport as you can see in the video:
    https://www.loom.com/share/48582526684143e1879f9ae9298593ee
    or am i wrong?

    Plugin Author Martin Stehle

    (@hinjiriyo)

    The plugin’s line defines more parameters than your line (minimum-scale and maximum-scale). So it overwrites more controls. That makes the zoom functionality more probable and more stable to work.

    Thread Starter bramvds

    (@bramvds)

    This no better solution?

    //* remove and replace parent theme actions
    function remove_actions_parent_theme() {
    remove_action(‘wp_head’,’flatsome_viewport_meta’, 1);
    }
    add_action(‘init’,’remove_actions_parent_theme’);
    //* Now re-add the customised action
    function child_viewport_meta_replacing_parent_theme() {
    echo apply_filters( ‘child_viewport_meta_replacing_parent_theme’, ‘<meta name=”viewport” content=”width=device-width, user-scalable=yes, initial-scale=1.0, minimum-scale=0.1, maximum-scale=10.0″>’ ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
    }
    add_action( ‘wp_head’, ‘child_viewport_meta_replacing_parent_theme’, 1 );`

    Plugin Author Kybernetik Services

    (@kybernetikservices)

    @bramvds I will check your solution and implent the remove_action if it is possible and useful. Stay tuned for the upcoming update.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘flatsome’ is closed to new replies.