-
Author
-
March 8, 2016 at 22:36 #109338
touren
ParticipantI already sorted out how to get a background banner in this area (styling > Alternate)
Now I want to have there the following:
a) how can I link the header background banner to an external website?
b) can I define for certain pages or categories a defined background banner which is different to the “general banner” set under styling > Alternate?
c) is it possible to have a rotating Header Background image banner? (is this perhaps possible with a revolution slider integration or is there another smarter way to manage this?thank you very much!
Attachments:
You must be logged in to view attached files.March 10, 2016 at 14:09 #109714sharmstr
ModeratorIf you’re going to leave your header layout like the image you attached, then you can create a slider the size you need and put it above or below the breadcrumb section with this code in your child theme’s functions.php file.
above
COPY CODEadd_action('kleo_before_main', 'inject_slider', 10); function inject_slider() { putRevSlider('banner', '8412,9511'); }
below
COPY CODEadd_action('kleo_before_content', 'inject_slider', 10); function inject_slider() { putRevSlider('banner', '8412,9511'); }
Change ‘banner’ to the name of your slider and change ‘8412,9511’ to the page ids that you want it displayed on.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
Attachments:
You must be logged in to view attached files.March 11, 2016 at 14:26 #109953touren
ParticipantWow! that´s great! many thanks.
Is also a conditional tag possible s.th. like
show on every pages/post revslider1 and on pages with ID2,4 only showing revslider2 instead of revslider1?March 11, 2016 at 14:40 #109955sharmstr
ModeratorYou can put as many as you want within the function.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 16, 2016 at 16:54 #110970touren
ParticipantWorks great! I want to do little modification!
I have used now this code
COPY CODEadd_action('kleo_before_main', 'inject_slider', 10); function inject_slider() { putRevSlider('headerbanner'); }
so that the banner is inserted on every page
how can I exclude injection on homepage and how can I use on my page ID 8175putRevSlider(‘contentbannerbig’); instead of putRevSlider(‘headerbanner’);
how do I have to extend the code above?
March 16, 2016 at 18:01 #110994sharmstr
ModeratorIf you look in rev slider, they tell you how to specify the page to put it on. Go to the slider settings and click on Embed Slider, then expand Advanced Embedding.
COPY CODEputRevSlider('headerbanner', '8175');
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 16, 2016 at 18:15 #110999touren
Participantbut if I have already defined
putRevSlider('headerbanner');
for whole site how do I then have to use
putRevSlider('headerbanner', '8175');
in order to “overwrite”putRevSlider('headerbanner');
? Do you understand my “problem” and how can I exclude showingputRevSlider('headerbanner');
on e.g. ‘homepage’ or another specific page?can you pls. post me a code example that would work for this?!
March 16, 2016 at 18:37 #111004sharmstr
ModeratorSorry, I missunderstood
You can use the WP functions is_front_page or is_page(‘ID’).
COPY CODEif (!is_front_page() && !is_page('8175') ){ putRevSlider('headerbanner'); }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 16, 2016 at 18:42 #111009touren
Participantok, I will try to get it work with your code example! thank you very much!
March 17, 2016 at 10:03 #111189touren
Participantsorry, I do not get it work as I want it – with your recent code I get the banner shown on homepage AND page ID 8175
but I want it this way
headerbanner shown on all sites
- except hompage AND Page ID 8175
And on page ID 8175 I want at the same position a different revolution slider integrated.
Pls. can you help me and paste me the relevant and working code for inserting putRevSlider!
Thank you very much – I hope it is now very clear how the integration of REvSlider should work!
March 17, 2016 at 12:24 #111208sharmstr
ModeratorDid you copy my code or did you type it yourself? In my code I have ‘!’ before the functions which means NOT. So the code actually does what you want it to. “If is NOT frontpage and is NOT page 8175 then show the slider”.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 17, 2016 at 13:02 #111216sharmstr
ModeratorTry this code instead. Let me know if this works. I tested on my site and it works fine.
COPY CODEif ( !is_front_page() ) { if ( !is_page('8175') ) { putRevSlider('headerbanner'); } }
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 17, 2016 at 16:40 #111269touren
Participanthi sharmstr,
thank you very much – it was my mistake – I messed up the code when I integrated it in my child theme.
now it works withCOPY CODEif (!is_front_page() && !is_page('8175') ){ putRevSlider('headerbanner'); }
when I want to exclude more pages like this
COPY CODEif (!is_front_page() && !is_page('8175,8121,7344') ){ putRevSlider('headerbanner'); }
it does not work I have to use it then this way
##COPY CODEif (!is_front_page() && !is_page('8175') && !is_page('8121') && !is_page('7344')){ putRevSlider('headerbanner'); }
is there a smarter way to exclude more pages?
March 17, 2016 at 17:02 #111284sharmstr
Moderatorbecause this is no page id that is 8175,8121,7344
!is_page(‘8175′,’8121′,’7344’)
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 17, 2016 at 17:04 #111285sharmstr
ModeratorAlso, the && shouldnt be working because that basically says “is the page the frontpage AND id xxx”. That’s why I gave you the second code example.
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionThis support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com
March 17, 2016 at 17:29 #111293touren
ParticipantThank you soooooo much!!
with
COPY CODEif (!is_front_page() && !is_page('8175') && !is_page('8121') && !is_page('7344')){ putRevSlider('headerbanner'); }
everything is working fine now! I also tried
COPY CODEif ( !is_front_page() ) { if ( !is_page('8175','8121','7344') ) { putRevSlider('headerbanner'); } }
but this does not work!
thank you so much for your great support!
April 18, 2016 at 13:41 #117184touren
Participanthow do I have to extend the code above when I want to have a specific slide of my “headerbanner” slider only shown on page id =201 for example?
Or do I have to create a new slider “page201” with only this slide and then define that this slider should only be shown up on page id=201 and the other slider “headerbanner” does not show up on this page?
how would be the code? -
AuthorPosts
The forum ‘General questions’ is closed to new topics and replies.