Adding sections to multiple pages
-
I’m trying to add sections to multiple pages in Customizr.
I followed the instructions in this post and all works well for a single page.
In the comments of the above post, someone else had my same issue and Nicholas gave a suggestion that isn’t working for me at the moment.
Here is my code:
$my_sections_args = array( 'ids' => array( 3941, 3946, 3956, 3972 ), 'blur' => false, 'background' => array( 3941 => "#004692", 3946 => "#ffb96d", 3956 =>"#004692", 3972=> "#ffb96d" ),//'randcolors' 'context' => '41', 'hook' => '__before_main_wrapper', 'apply_shadow' => false, 'layout' => 'full', ); $my_sections_tea = array( 'ids' => array( 4026 ), 'blur' => false, 'background' => array( 4026 => "#004692"),//'randcolors' 'context' => '27', 'hook' => '__before_main_wrapper', 'apply_shadow' => false, 'layout' => 'full', ); function apply_contextual_sections() { if ( is_page(41) ) { add_custom_sections ( $my_sections_args ); } else if ( is_page(27) ) { add_custom_sections ( $my_sections_tea ); } } add_action('template_redirect' , 'apply_contextual_sections' );
Please help!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Adding sections to multiple pages’ is closed to new replies.