Poste Facebook Like Box on wp site - Resizing pc/mobile

Discussion in 'Gommero WordPress Theme' started by mwnow, Oct 2, 2013.

Thread Status:
Not open for further replies.
  1. mwnow

    mwnow Member

    Joined:
    Sep 23, 2013
    Messages:
    82
    Likes Received:
    3
    Hello,

    I have generated a Facebook Like Box on this page:
    https://developers.facebook.com/docs/reference/plugins/like-box/

    The Code the "Generator" put out is that one: (i choose the HTML 5 Code)

    Code:
    <div id="fb-root"></div>
    <script>(function(d, s, id) {
      var js, fjs = d.getElementsByTagName(s)[0];
      if (d.getElementById(id)) return;
      js = d.createElement(s); js.id = id;
      js.src = "//connect.facebook.net/de_DE/all.js#xfbml=1&appId=538934679516193";
      fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));</script>
     
     
    <div class="fb-like-box" data-href="https://www.facebook.com/zartherb" data-width="250" data-height="800" data-colorscheme="dark" data-show-faces="false" data-header="false" data-stream="true" data-show-border="false" scrolling="no"></div>
    

    I post that code on my wordpress site "News".
    The code works on pc an smartphone. :)


    BUT:
    If I want, that the Like Box goes about Full Width (on Smartphone) I have an maximum data-width="250".

    > This looks on the PC (and Tablet) not so nice...
    Please see attached file.

    How can I provide 2 versions of the Like Box?
    The smaller one using width 250 for smartphones....
    And the bigger one using width 600 for showing on pc?

    Do you know what I mean?
    I have tried it by my one, but it won´t work.

    Maybe in style css of the Theme?

    Hope you can help me!


     
  2. mwnow

    mwnow Member

    Joined:
    Sep 23, 2013
    Messages:
    82
    Likes Received:
    3
    see Picture sizing_on_pc_to_small.jpg
     
  3. mwnow

    mwnow Member

    Joined:
    Sep 23, 2013
    Messages:
    82
    Likes Received:
    3
  4. Piyush

    Piyush Support Staff

    Joined:
    Dec 8, 2012
    Messages:
    4,745
    Likes Received:
    107
    Hello,

    Paste the following code in your Custom CSS
    (Appearance -> Theme Options -> Styling Options -> Custom CSS)
    Code:
    #facebook {
    width: 600px;
    }
    .fb_iframe_widget iframe {
    width: 600px! important;
    }
    @media only screen and (max-width: 767px) and (min-width: 480px){
    .fb_iframe_widget iframe {
    width: 430px! important;
    }
    }
    @media only screen and (max-width: 480px){
    .fb_iframe_widget iframe {
    width: 250px! important;
    }
    }
    You can adjust the value of "width" as per your requirement.
    This will solve your issue.
     
  5. mwnow

    mwnow Member

    Joined:
    Sep 23, 2013
    Messages:
    82
    Likes Received:
    3
    Great Piyush!

    It works perfect :)
     
    admin likes this.
Thread Status:
Not open for further replies.

Share This Page