Tagged: x
-
AuthorPosts
-
May 29, 2016 at 8:37 pm #1015788
nikolasaParticipantHeya – I’d like to add an image to the top of all blog posts (single) as well as the archive blog pages. Just wondering if you have some code I could place in there?
Thanks!
May 29, 2016 at 8:38 pm #1015792
nikolasaParticipantThis reply has been marked as private.May 29, 2016 at 10:09 pm #1015921
Rue NelModeratorHello There,
Thanks for writing in! What you are trying to accomplish requires a template customization, we would like to suggest that you use a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
Once you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.
// Add custom image in blog, archive and single post // ============================================================================= function add_custom_image(){ ?> <?php if ( is_single() || is_archive() || is_home() ) : ?> <div id="custom-image"> <div class="x-container max width"> <img src="http://placehold.it/1200x300/" alt="Custom Image" /> </div> </div> <?php endif; ?> <?php } add_action('x_before_view_renew__landmark-header', 'add_custom_image'); // =============================================================================Please let us know if this works out for you.
May 30, 2016 at 4:02 am #1016196
nikolasaParticipantThat is awesome!! Worked great! But how do I style it? I’m just wanting it fullscreen, so it matches the rest of the site.
May 30, 2016 at 4:21 am #1016213
LelyModeratorHi There,
Please add this CSS on Appearance > Customize > Custom > Edit Global CSS:
#custom-image >div { width: 100%; max-width: initial; }Hope this helps.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1015788 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
