Tagged: x
-
AuthorPosts
-
January 24, 2017 at 6:51 am #1343020
Suzanne SParticipantOh, 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/”,”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’);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″
/></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?
January 24, 2017 at 6:55 am #1343023
Suzanne SParticipantThis reply has been marked as private.January 24, 2017 at 8:52 am #1343194
LelyModeratorHello 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.
January 24, 2017 at 9:58 am #1343297
Suzanne SParticipantThank 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?
January 24, 2017 at 11:52 am #1343445
JadeModeratorHi 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.
January 25, 2017 at 3:27 am #1344419
Suzanne SParticipantHi,
That code doesn’t work, sorry.
January 25, 2017 at 8:13 am #1344702
LelyModeratorHi 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.January 25, 2017 at 11:15 am #1344991
Suzanne SParticipantHi,
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
SuzanneJanuary 25, 2017 at 4:15 pm #1345353
FriechModeratorHi Suzanne,
Would you mind providing us FTP credentials in private reply so we can take a closer look.
Thanks.
January 26, 2017 at 12:02 am #1345878
Suzanne SParticipantThis reply has been marked as private.January 26, 2017 at 12:46 am #1345911
FriechModeratorHi 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!
January 26, 2017 at 12:54 am #1345916
Suzanne SParticipantIt’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!
January 26, 2017 at 1:01 am #1345921
FriechModeratorHi 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; } }🙂
January 26, 2017 at 1:49 am #1345966
Suzanne SParticipantAbsolutely perfect! thank you.
The support here has been fantastic these last few days 🙂
Have a great day all
SuzanneJanuary 26, 2017 at 2:06 am #1345985
LelyModeratorYou’re welcome Suzanne!
Cheers!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1340775 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
