• Resolved webdevtestus

    (@webdevtestus)


    Hi there and thanks in advance,
    NOTE: The site is NSFW, just some ebooks for adults (romance and that stuff, but the ebooks covers may be hot).

    My environment:
    I have WP with woocommerce, storefront+bookshop child theme
    I have the Snippets plugins where I add all my PHP code
    And I add CSS to Custom CSS within customize

    Now the problem:
    I can′t figure out how to make site header, top nav bar and logo + buttons responsive.
    The fact is that I could get some Top header styling using some PHP and CSS, BUT when I go to mobile view, the Top nav var, header, logo and menu goes crazy!

    I need to fix that, I don′t know what to try (I googled a lot, tried changing values, %, float, inline, block, important, wathever) but I can′t get the right tip.

    I don{t know if the child theme or storefornt itself is overriding my attemps, maybe i have to unhook some function.

    Maybe is just as simple as putting all 3 PHP snippets into one div and many spans tag, but I can′t figure out how, I am burnt today.

    I would thank any advice.

    Here goes my CSS

    /*Remove space between header and Menu*/
    .site-header {
    height: 135px;
    }
    .col-full {
    top: -84px;
    }

    /**************************/

    /* Logo size for mobile site */
    @media screen and (max-width: 768px) {
    .site-header .site-branding img {
    max-height: none !important;
    max-width: none !important;
    width: 322px !important;
    }
    }

    /*Remove title from Shop page*/
    .woocommerce-products-header
    {display: none;}

    /*Hide Pages Tite with custom Class added to PHP snippets*/
    .hidetitle .entry-header {
    display:none;
    }

    /*Make primary Pages full width*/
    body.woocommerce #primary {
    width: 100%;
    }

    /*Align Search Bar and make text pink*/
    #woocommerce-product-search-field-0 {
    display:inline-block;
    width:100%;
    color: #fe00a1;
    border: solid 1px #fe00a1;
    }

    /*Edited Cart*/
    #site-header-cart{
    padding-bottom:20px;
    width:15%;
    }

    /*Changed cart icon bag f\290 to to cart icon f\217 */
    .site-header-cart .cart-contents:after,
    .storefront-handheld-footer-bar ul li.cart > a:before {
    content: “\f217”;
    }

    /*Align Help link*/
    #help{
    display:inline-block;
    padding-left: 35px;
    padding-right: 35px;
    }

    /*Align Gift card*/
    #gift-cardl{
    margin-left:80px;
    }

    /*JoinAngel button style*/
    .JoinAngel {
    width:auto;
    height: 35px;
    margin-top: 15px;

    }
    /*Center collague image*/
    .collague_image {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width:100%;
    }

    /*Add top padding to rectangle*/
    #rectangle {
    padding:17px;
    }

    /*Remove Storefront footer credit*/
    .site-footer .site-info {
    display: none;
    }

    and here my PHP

    add_action( ‘storefront_header’, ‘header_custom_gift_button’, 40 );
    function header_custom_gift_button() { ?>
    <span>

    <button id=”gift-cardl”>Gift Card</button>
    </span>
    <?php
    }

    //////////////////////////////////////////////

    add_action( ‘storefront_header’, ‘header_custom_help_link’, 40 );
    function header_custom_help_link() { ?>
    <span style=”width:100%;”>
    Help
    </span>
    <?php
    }

    /////////////////////////////////////////

    add_action( ‘storefront_header’, ‘header_custom_subscribe_button’, 40 );
    function header_custom_subscribe_button() { ?>

    <button class=”subscribe_newsletter_btn”>Get Daily Book Bargains</button>
    </span>
    <?php
    }

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Your original code:

    <div class="site-branding">
    			<a href="https://sitetest.wigigx.com/" class="custom-logo-link" rel="home"><img width="230" height="45" src="https://sitetest.wigigx.com/wp-content/uploads/2019/06/naughty-angel-books-transparent_230x45.png" class="custom-logo" alt=""></a>		</div>

    Remove the hardcoded dimensions from your image:

    <img src="https://sitetest.wigigx.com/wp-content/uploads/2019/06/naughty-angel-books-transparent_230x45.png" class="custom-logo" alt="">

    • This reply was modified 5 years, 4 months ago by a2hostinglk.

    Remove dimensions from your CSS as well:

    @media screen and (max-width: 768px)
    .site-header .site-branding img {
        /* max-height: none !important; */
        /* max-width: none !important; */
        /* width: 322px !important; */
    }

    Now, if you test your site, your logo should be responsive. Let me know if you have any questions.

    Thread Starter webdevtestus

    (@webdevtestus)

    Hi a2hostinglk, and thanks a lot!
    Ok, I tried it and it didn′t work as ecpected, the logo goes smaller and left-handed, maybe I failed to remove harcoded Width and height, I used a php function to do it, I′ll try it again later, maybe I am overthinking all and making things difficult myself.

    I do have another questions if you qre so kind.
    The thing that is making me mad (besides th logo) is trying to fix the top header buttons and URL, these are:
    Gift card
    Help
    Get daily book bargains.

    When going to mobile they appear in no particular order, just one above the other with no left-margin or right aligned, just..they appear (I think they take the margin that I added via CSS and I can′t override it with some responsive code).

    I don′t know, maybe i should try some felxbox up there?

    or putting all that 3 codes (3 PHP snippets) within only one with a big DIV containing 3 SPAN?

    Thanks in advance for your help

    Thread Starter webdevtestus

    (@webdevtestus)

    And, by the way, when responsive the MENU brings ALL the pages, products, everything, when in WEB works ok, with just 5 menu tabs visible ??why?

    Thanks

    Thread Starter webdevtestus

    (@webdevtestus)

    Regarding Menu, it is ok, my mistake, forgot to activate handheld menu in Menu tab, sorry, working fine now, but I still need to arrange the menu drop down ??

    Thread Starter webdevtestus

    (@webdevtestus)

    solved!!

    Regarding Menu, it is ok, my mistake, forgot to activate handheld menu in Menu tab, sorry, working fine now,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Can′t make top header nav and logo responsive’ is closed to new replies.