Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1144151
    kik4adog
    Participant

    Is there a quick and easy way to add a banner to all of the pages/posts on my site via a code? For instance, I have a sponsor who hosts their own banner, so currently I just install the code onto the specific page of my site where I want it. But they have communicated to me that they would like it on every page/post of my site. The code I am using is

    <a href="http://www.mousefantravel.com?apid=aatm">
    <img src="http://mei-banners.s3.amazonaws.com/b/red_lg.gif" /></a>

    I tried using the “Text” widget in Header 1, but I didn’t see where it did anything. Then I tried Header 2 and Header 3, and still nothing. Finally I tried Footer 1, and I still didn’t see any changes.

    My site is located at http://www.allaboutthemousecentral.com.

    Thanks in advance

    #1144560
    Friech
    Moderator

    Hi There,

    Thanks for writing in! Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released.

    Then add this on your child theme’s functions.php file.

    add_action( 'x_before_the_content_begin', 'add_to_everypage' );
    function add_to_everypage() { ?>
    <div class="x-container max width center-text">
    <a href="http://www.mousefantravel.com?apid=aatm"><img src="http://mei-banners.s3.amazonaws.com/b/red_lg.gif" /></a>
    </div>
    <?php }

    Hope it helps, Cheers!

    #1145701
    kik4adog
    Participant

    This worked great! Thank you!

    #1145999
    Prasant Rai
    Moderator

    You are most welcome. 🙂

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