Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1343020
    Suzanne S
    Participant

    Oh, I did figure out what I’ve done! I created a header.php and placed this in my child theme…oops! sorry.

    This is what was on it:

    ?php

    // =============================================================================
    // HEADER.PHP
    // —————————————————————————–
    // The site header. Variable output across different stacks.
    //
    // Content is output based on which Stack has been selected in the Customizer.
    // To view and/or edit the markup of your Stack’s index, first go to “views”
    // inside the “framework” subdirectory. Once inside, find your Stack’s folder
    // and look for a file called “wp-header.php,” where you’ll be able to find the
    // appropriate output.
    // =============================================================================

    ?>

    <?php x_get_view( x_get_stack(), ‘wp’, ‘header’ ); ?>

    <!– Begin Cookie Consent plugin by Silktide – http://silktide.com/cookieconsent –>
    <script type=”text/javascript”>
    window.cookieconsent_options = {“message”:”This website uses cookies to ensure you get the best experience on our website”,”dismiss”:”Got it!”,”learnMore”:”Learn More”,”link”:”http://www.howtostartworkingathome.com/privacy-policy/&#8221;,”theme”:”light-top”};
    </script>

    <script type=”text/javascript” src=”//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/1.0.10/cookieconsent.min.js”></script>
    <!– End Cookie Consent plugin –>

    <!– Facebook Pixel Code –>
    <script>
    !function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
    n.push=n;n.loaded=!0;n.version=’2.0′;n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
    document,’script’,’https://connect.facebook.net/en_US/fbevents.js&#8217;);

    fbq(‘init’, ‘323144024690630’);
    fbq(‘track’, “PageView”);</script>
    <noscript><img height=”1″ width=”1″ style=”display:none”
    src=”https://www.facebook.com/tr?id=323144024690630&ev=PageView&noscript=1&#8243;
    /></noscript>
    <!– End Facebook Pixel Code –>

    <script type=”text/javascript”>
    (function (tos) {
    window.setInterval(function () {
    tos = (function (t) {
    return t[0] == 50 ? (parseInt(t[1]) + 1) + ‘:00’ : (t[1] || ‘0’) + ‘:’ + (parseInt(t[0]) + 10);
    })(tos.split(‘:’).reverse());
    window.pageTracker ? pageTracker._trackEvent(‘Time’, ‘Log’, tos) : _gaq.push([‘_trackEvent’, ‘Time’, ‘Log’, tos]);
    }, 10000);
    })(’00’);
    </script>

    Also, I have confused header.php with the <head> tag (Where is the <head> tag?)

    Is all the code above everything? Where do I add my cookie consent code?

    #1343023
    Suzanne S
    Participant
    This reply has been marked as private.
    #1343194
    Lely
    Moderator

    Hello Suzanne,

    Please remove the code you have added on header.php and add the following instead on your child theme’s functions.php:

    function third_party_tracking_code() { ?>
    
     
        <!-- Add Consent Plugin, Facebook and all other tracking code that you have on header.php here-->
      
    
    <?php }
    
    add_action( 'wp_head', 'third_party_tracking_code' );

    Hope this helps.

    #1343297
    Suzanne S
    Participant

    Thank you so much I’ve added the code to header.php

    You’ve all been so helpful with this issue I hope my site’s coding is all good now 🙂

    Would I be able to have the code now that will fix my topbar to my navbar but to move up on mobile please?

    #1343445
    Jade
    Moderator

    Hi Suzanne,

    Please try this code:

    @media (max-width: 979px) {
        .x-navbar.x-navbar-fixed-top {
            position: fixed !important;
            display: block !important;
            width: 100% !important;
            z-index: 999 !important;    
        }
    }

    Hope this helps.

    #1344419
    Suzanne S
    Participant

    Hi,

    That code doesn’t work, sorry.

    #1344702
    Lely
    Moderator

    Hi Suzanne,

    Let’s fixed CSS syntax error first. This error will prevent other CSS from working.
    Look for this part:

    @media (min-width:  768px) {
    		.blog .entry-featured, .archive .entry-featured {
    		max-width: 250px;
    		float: left;
    		margin: 2em 1.5em 0 0;
    }

    Add the closing curly brace for media queries.Like this:

    @media (min-width:  768px) {
    		.blog .entry-featured, .archive .entry-featured {
    		max-width: 250px;
    		float: left;
    		margin: 2em 1.5em 0 0;
    }
    } /*This was added*/
    

    Then add the suggested CSS again.
    Hope this helps.

    #1344991
    Suzanne S
    Participant

    Hi,

    No sorry I fixed the first piece of code and then added the second and nothing happened.
    I then went back and re-tried all the other codes and the only one that does anything is:

    @media only screen and (min-width: 980px) {
    header.masthead.masthead-inline {
    position: fixed !important;
    display: block !important;
    width: 100% !important;
    z-index: 999 !important;
    }
    header.x-header-landmark {
    margin-top: 166px;
    }
    }

    But this pushes the container with the titles and the content up behind the navbar, how can I edit the above code to fix this?

    regards
    Suzanne

    #1345353
    Friech
    Moderator

    Hi Suzanne,

    Would you mind providing us FTP credentials in private reply so we can take a closer look.

    Thanks.

    #1345878
    Suzanne S
    Participant
    This reply has been marked as private.
    #1345911
    Friech
    Moderator

    Hi Suzanne,

    Yes I just saw it now, sorry about that. I did go ahead and made the topbar fixed but not on mobile just like the navbar.

    If you wonder what I did, please read my previous reply: https://community.theme.co/forums/topic/header-and-blog-adjustments/#post-1342559

    Yes, I did not anticipate the “titles and breadcrumbs behind the header” issue, I did resolve that now by adding the custom CSS below on your child theme’s style.css

    @media (min-width:  980px) {
    	.x-header-landmark {margin-top: 50px;}
    }

    Remember to clear your browser’s cache, to make sure your browser is reading the codes that I added.

    Hope it helps, Cheers!

    #1345916
    Suzanne S
    Participant

    It’s still not right, if you see the homepage content is pushed slightly up

    https://howtostartworkingathome.com/

    and the blogroll has a slight gap between the navbar and the titles

    https://howtostartworkingathome.com/articles/

    sorry this is such a nightmare!

    #1345921
    Friech
    Moderator

    Hi Suzanne,

    No its ok, please open/edit your child theme’s style.css file. And update the .x-header-landmark {margin-top: 50px;} value to 46px (that is the height of the topbar that we need to offset)

    For the home page, add a top margin 46px on the first section.

    Update: Actually that is not responsive; please update this block:

    @media (min-width:  980px) {
    	.x-header-landmark {margin-top: 50px;}
    }

    To this instead:

    @media (min-width:  980px) {
    	.x-header-landmark,
    	.page .x-main.full {
    		margin-top: 46px;
    	 }
    }

    🙂

    #1345966
    Suzanne S
    Participant

    Absolutely perfect! thank you.

    The support here has been fantastic these last few days 🙂

    Have a great day all
    Suzanne

    #1345985
    Lely
    Moderator

    You’re welcome Suzanne!

    Cheers!

  • <script> jQuery(function($){ $("#no-reply-1340775 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>