Tagged: x
-
AuthorPosts
-
November 29, 2016 at 7:41 am #1274622
Ying-Fu LiParticipantHi,
I have added this code to the function.php of a new site:
add_action('x_after_site_begin', function(){ ?> <!-- your TEXT/HTML content here --> <!-- Example Start --> <div class="my_top_section"> <img src="" /> <h2><i class="fa-icon-chevron-right"></i> PERSOONLIJKE VERKOOP VOOR ZZP'ERS <i class="fa-icon-chevron-left"></i></h2> </div> <style> h2, .h2 { margin: 0.25em 0 0; } .my_top_section { text-align: center; background-color: #ffffff; height: 125px; border-bottom: 2px solid #e2001a; } </style> <!-- Example End --> <?php });Now I want this only to be shown on the homepage. How do I do that?
Thanks!
November 29, 2016 at 7:54 am #1274638
ThaiModeratorHi There,
Please try with this code instead:
add_action('x_after_site_begin', function(){ if(is_home()){ ?> <!-- your TEXT/HTML content here --> <!-- Example Start --> <div class="my_top_section"> <img src="" /> <h2><i class="fa-icon-chevron-right"></i> PERSOONLIJKE VERKOOP VOOR ZZP'ERS <i class="fa-icon-chevron-left"></i></h2> </div> <style> h2, .h2 { margin: 0.25em 0 0; } .my_top_section { text-align: center; background-color: #ffffff; height: 125px; border-bottom: 2px solid #e2001a; } </style> <!-- Example End --> <?php } });If it doesn’t work, please replace is_home() with is_front_page()
Cheers!
November 29, 2016 at 9:14 am #1274728
Ying-Fu LiParticipantThanks. ‘is_front_page()’ did the trick.
November 29, 2016 at 9:17 am #1274733
ThaiModeratorYou’re most welcome 🙂
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1274622 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
