This topic has 6 replies, 2 voices, and was last updated 9 years by sharmstr.

  • Author
  • #69952
     mitchcan
    Participant

    Yelp.

    I’ve been like a ‘dog chasing his tail’ for several hours trying to get a Revolution Slider to show up on the top of the page that is set as “Posts Page” in /admin/reading settings. Now I understand that anything I add as content to the page set as such does not display… I get that.

    So instead I tried to post something in the widget area I created and placed in functions in the ‘before_main_content’ – don’t get me started on how many different ways I got that to display on about every page EXCEPT the one I wanted.

    COPY CODE
    /* this added a widget area before main content ONLY not SB - works on Kleo pages */
    add_action('kleo_before_main_content','kleo_top_main_content');
    function kleo_top_main_content() {
         echo '<div id="before-main-content">', do_shortcode('[widgets_on_pages id="wop-3"]'), '</div>';  //shortcode possible here
    } 

    I try and place the Rev Slider widget in the widget area ‘wop-3’, and it only displays the title, and it displays it on every page EXCEPT the page id listed to use in the Rev Slider widget – but maybe that’s because I listed the Posts Page id, and that doesn’t work right when set in /reading. I dunno?

    Anyhoo, to make a short story long, I’m simply trying to get a Revolution Slider to show up in the before_main_content area and ONLY on the Page that is set as Posts Page in /admin/reading.

    Any wisdom out there to point me in a direction… it don’t seem likely that this dog is gonna catch his damn tail. 🙂

    Thanks.

    #69970
     sharmstr
    Moderator

    is_home will check to see if the current page is your blog page. http://codex.wordpress.org/Conditional_Tags#The_Blog_Page

    You dont need to use widgets on page. You can use putRevSlider to add the slider you want.

    COPY CODE
    
    add_action('kleo_before_main_content','kleo_top_main_content');
    function kleo_top_main_content() {
        if (is_home()) {
            echo '<div id="before-main-content">', putRevSlider( "yourslideralias" ), '</div>';
        }
    }
    
    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

    #70000
     mitchcan
    Participant

    OK, first, that’s hilarious. This entire time I’ve been specifically trying NOT to place it on home, thinking home meant, well, you know, Home (as in Front Page) vs Posts. In my last theme, I didn’t mess with the reading settings, it was built to overtake the Your Latest Posts setting. So I missed that info. Thanks.

    But back to the strategy of placing it via the widgets setup.

    My rationale, possibly flawed as usual, 🙂 was that I often use multiple widgets in each of the widget ‘areas’ I created in kleo_before_content, kleo_before_main etc, then I use Dynamic Widgets plugin to determine the display of each widget.

    In using the Rev Slider php directly, I don’t want to lose the ability to still use that widget ‘area.’

    I’m no php guy, but can I still make that happen by doing something like

    COPY CODE
    add_action('kleo_before_main_content','kleo_top_main_content');
    function kleo_top_main_content() {
        if (is_home()) {
            echo '<div id="before-main-content">', putRevSlider( "featured-posts" ), '</div>';
    }
    else 
    {
    echo '<div id="before-main-content">', do_shortcode('[widgets_on_pages id="wop-3"]'), '</div>';  //could put shortcode here
       }
    } 

    I have no clue if that is structurally correct, but conceptually, would something like that work to allow me to still have the ‘wop-3’ widget area functional?

    Thanks for setting me straight on some of the usage here.

    Have a great weekend!

    #70001
     sharmstr
    Moderator

    Yep. That should do it.

    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

    #70002
     sharmstr
    Moderator

    and by the way, after all this time, I still think its is_blog, then I google it and remember its is_home 🙂

    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

    #70003
     mitchcan
    Participant

    It’s funny, but it NEVER even occurred to me to even remotely consider using is_home() when I was specifically trying to NOT place it on the “home” page. I was fixated on page id 122731 (which is the id of the page that I set as Posts in /reading) as the way to get the slider on the blog posts page. Ooops. 🙂

    Thanks again!

    #70004
     sharmstr
    Moderator

    ahahahahaha I just noticed your tags.

    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

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

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

Log in with your credentials

Forgot your details?