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.
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!
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.
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
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;
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.