[Support request] hiding sections using hide-on-desktop class not working

Home Forums Support [Support request] hiding sections using hide-on-desktop class not working

Home Forums Support hiding sections using hide-on-desktop class not working

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1356004
    Avinash

    Hi

    I am trying to use sections, to show/hide content on the home page based on whether it is a mobile user or desktop.

    Now, the class hide-on-desktop works well on sections as long as the content in the section does not include a shortcode. However, since the content I am trying to display is dynamic and retreived via custom shortcode, the class hide-on-desktop is not working.

    This is the URL.

    https://www.theinsidervoice.in/home-mobile/

    The content must show only on mobiles not on desktops.

    How can i address this issue

    Pls help

    #1356209
    David
    Staff
    Customer Support

    Hi there,

    Its to do with how the Shortcode is returning its content – Is it a plugin or a custom function that is generating the Shortcode ?

    #1357286
    Avinash

    It is a custom plugin, that retrieves data from the backend and displays in table format

    #1357541
    David
    Staff
    Customer Support

    If you look at your sites markup you will see that the Tables are displayed outside of the Section.
    This happens when the shortcode ‘echoes’ its output. It needs to return a single value or use output buffering to display within the container.

    https://codex.wordpress.org/Shortcode_API

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.