Tagged: x
-
AuthorPosts
-
October 26, 2016 at 4:24 pm #1232133
TinBerakovicRacingParticipantHello,
I would like to post a banner image right where the Post Slider should be but i want it to be a static image with no caption or link. I would also like to have a different image for each category archive and page (i have 4 categories and 1 page)
Is there a way to do it?
October 26, 2016 at 5:31 pm #1232217
Nabeel AModeratorHi there,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
October 26, 2016 at 9:35 pm #1232523
TinBerakovicRacingParticipantOctober 27, 2016 at 12:39 am #1232678
RadModeratorHi there,
Please add this code to your child theme’s functions.php
add_actio('x_before_view_ethos__post-slider', 'the_static_banner'); function the_static_banner () { if ( is_category() ) { global $wp_query; $images = array ( 232 => 'http://example.com/path/to/the/image.jpg', 235 => 'http://example.com/path/to/the/image.jpg', 237 => 'http://example.com/path/to/the/image.jpg', ); $current_image = $images[ $wp_query->get_queried_object_id() ]; if ( !empty( $current_image ) ) { echo '<div class="category_banner"><img src="'.$current_image.'"></div>'; } } }Then change this part to add your category ID and its image banner’s URL.
array ( 232 => 'http://example.com/path/to/the/image.jpg', 235 => 'http://example.com/path/to/the/image.jpg', 237 => 'http://example.com/path/to/the/image.jpg', );Cheers!
October 27, 2016 at 10:24 am #1233289
TinBerakovicRacingParticipantI’ve added this to child theme and the images aren’t showing on either the homepage or the category archives
October 27, 2016 at 1:05 pm #1233550
JadeModeratorHi there,
I have tried to check on your site and it seems to be inaccessible at the moment.
Kindly double check so that we could check it on our end.
October 29, 2016 at 10:34 am #1235937
TinBerakovicRacingParticipantIt’s working for me.
Should I send you login information?October 29, 2016 at 12:19 pm #1236005
ThaiModeratorHi There,
Please provide us with your admin account & password.
Thanks.
October 30, 2016 at 6:04 pm #1237018
TinBerakovicRacingParticipantThis reply has been marked as private.October 30, 2016 at 10:20 pm #1237306
Rue NelModeratorHello There,
Please modify the code and use these lines:
array ( 3 => 'http://example.com/path/to/the/image.jpg', 7 => 'http://example.com/path/to/the/image.jpg', 6 => 'http://example.com/path/to/the/image.jpg', 4 => 'http://example.com/path/to/the/image.jpg' );3, 7, 6, 4 is the category ID. To get the category ID, please check this out: https://community.theme.co/kb/how-to-locate-category-ids/
Hope this helps.
October 31, 2016 at 10:04 am #1237957
TinBerakovicRacingParticipantThis worked for the categories, thanks, but I would like it to show on the homepage as well
October 31, 2016 at 10:20 am #1237994
TinBerakovicRacingParticipantAlso can it appear over the title of the category instead of under it?
Thank you so much!
October 31, 2016 at 12:28 pm #1238154
Nabeel AModeratorHi again,
1. To display the title over the banner image, add this code in your Customizer via Appearance > Customize > Custom > Edit Global CSS:
.category_banner { margin-top: -110px; float: left; } .category .h-landmark span { color: white !important; position: relative; z-index: 1; padding: 20px; }2. To add the banner on homepage, just add the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript
jQuery(document).ready(function($){ $('.home .x-container.max.width.main').prepend('<img src="https://s-media-cache-ak0.pinimg.com/originals/5f/85/29/5f85292b3dfb0fdbc6c10a5ea253ddc2.jpg">'); });Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1232133 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
