This topic has 16 replies, 2 voices, and was last updated 8 years by touren.

  • Author
  • #109338
     touren
    Participant

    I 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.
    #109714
     sharmstr
    Moderator

    If 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 CODE
    
    add_action('kleo_before_main', 'inject_slider', 10);
    function inject_slider() {
        putRevSlider('banner', '8412,9511');
    }
    

    below

    COPY CODE
    
    add_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 solution

    This 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.
    #109953
     touren
    Participant

    Wow! 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?

    #109955
     sharmstr
    Moderator

    You 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #110970
     touren
    Participant

    Works great! I want to do little modification!

    I have used now this code

    COPY CODE
    add_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?

    #110994
     sharmstr
    Moderator

    If 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 CODE
    
    putRevSlider('headerbanner', '8175');
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #110999
     touren
    Participant

    but 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 showing putRevSlider('headerbanner'); on e.g. ‘homepage’ or another specific page?

    can you pls. post me a code example that would work for this?!

    #111004
     sharmstr
    Moderator

    Sorry, I missunderstood

    You can use the WP functions is_front_page or is_page(‘ID’).

    COPY CODE
    
    if (!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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #111009
     touren
    Participant

    ok, I will try to get it work with your code example! thank you very much!

    #111189
     touren
    Participant

    sorry, 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!

    #111208
     sharmstr
    Moderator

    Did 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #111216
     sharmstr
    Moderator

    Try this code instead. Let me know if this works. I tested on my site and it works fine.

    COPY CODE
    
    if ( !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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #111269
     touren
    Participant

    hi 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 with

    COPY CODE
    if (!is_front_page() && !is_page('8175') ){
    putRevSlider('headerbanner');
    }

    when I want to exclude more pages like this

    COPY CODE
    if (!is_front_page() && !is_page('8175,8121,7344') ){
    putRevSlider('headerbanner');
    }

    it does not work I have to use it then this way
    ##

    COPY CODE
    if (!is_front_page() && !is_page('8175') && !is_page('8121') && !is_page('7344')){
    putRevSlider('headerbanner');
    }

    is there a smarter way to exclude more pages?

    #111284
     sharmstr
    Moderator

    because 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #111285
     sharmstr
    Moderator

    Also, 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 solution

    This support site is not about custom work. If you need custom development please contact cornel@seventhqueen.com

    #111293
     touren
    Participant

    Thank you soooooo much!!

    with

    COPY CODE
    if (!is_front_page() && !is_page('8175') && !is_page('8121') && !is_page('7344')){
    putRevSlider('headerbanner');
    }

    everything is working fine now! I also tried

    COPY CODE
    if ( !is_front_page() ) {
            if ( !is_page('8175','8121','7344') ) {
                putRevSlider('headerbanner');
            }
        }

    but this does not work!

    thank you so much for your great support!

    #117184
     touren
    Participant

    how 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?

Viewing 17 posts - 1 through 17 (of 17 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?