• Resolved CorneliusJr

    (@corneliusjr)


    Greetings and thank you!

    I have a page with a special slider that only appears on that page. There is copy on the page, and I would like that copy and the title of the article/page to appear above the slider.

    I am sure people have asked this but I have already spent too much billable time looking for the answer.

    Here is a link to the page.

    https://devildoginstallations.com/wp/?page_id=115

    Thank you in advance; I appreciate you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi you can add this to your child-theme functions.php:

    add_action('wp_head', 'move_slider_after_content');
    function move_slider_after_content(){
      if ( ! is_page('135') )   /* don't do nothing if is not that page with id 115*/
        return;
      //repositioning of the slider
      remove_action('__after_header', array(TC_slider::$instance, 'tc_slider_display') );
      add_action('__after_main_wrapper', array(TC_slider::$instance, 'tc_slider_display'), 0 );
    }

    Hope this helps.

    Thread Starter CorneliusJr

    (@corneliusjr)

    Fabulous! Thank you! I had to make one small correction. I noticed the page numbers didn’t match, and changed ‘135’ to ‘115’ and that did it!

    I am very grateful. I’ll mark this “resolved”. I am sure it will help others, too.

    Thank again!

    Ahhh sorry I tested it on my test site and forgot to change the page with your page id.
    Glad you solved!

    Thread Starter CorneliusJr

    (@corneliusjr)

    What I don’t understand is why we have to do this. Who wants their slider to get pushed further down the page as you add content? I’m not sure I’ve ever seen such a thing. Shouldn’t main content appear below the slider by default? Great theme! Good work. Nothing is perfect. Just an observation.

    Thread Starter CorneliusJr

    (@corneliusjr)

    Hm. How do I get this to happen on two different pages with two different sliders? I think the system is not liking duplicate code. Just my theory. Here is the error.

    Fatal error: Cannot redeclare move_slider_after_content() (previously declared in /home/devildog/public_html/wp-content/themes/customizr-child/functions.php:8) in /home/devildog/public_html/wp-content/themes/customizr-child/functions.php on line 40

    Thread Starter CorneliusJr

    (@corneliusjr)

    I removed the code and still get the error. So I removed the code for the other slider/page (the original entry from this thread) and still get error. Uploading functions.php from recent backup and hope that gets the site back online. I’ll check in again in the hope that not only can I achieve my goal, but that the process may contribute to the community. Thank you.

    HI,
    Though this is resolved, just thought I shall add to it.
    Add the other page also in the if condition.
    For example. if the other page id is 120,

    if ( ! (is_page('115') || is_page('120')) )   /* don't do nothing if is not that page with id 115 or 120*/
        return;

    or alternately

    if ( !is_page('115') && !is_page('120') )   /* don't do nothing if is not that page with id 115 or 120*/
        return;

    Thread Starter CorneliusJr

    (@corneliusjr)

    Thank you, Menaka S! Yes, the original issue was resolved months ago, but when I ran into this related problem and did a search my own tread came up. So I picked up where I left off. I wasn’t sure if I should have switched the status out of “resolved” or not. So I’m glad you found it! I’ll try this solution, which I am confident will work, and let you know how it went.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Move slider below content’ is closed to new replies.