| 1 |
<?php |
| 2 |
/*Template Name: Scrollsequence Template |
| 3 |
*/ |
| 4 |
|
| 5 |
/* HANDLE HEADER - since 1.3.2, to remove errors with FSE themes */ |
| 6 |
if ( function_exists('wp_is_block_theme') && wp_is_block_theme()){ |
| 7 |
// HANDLE HEADER FOR BLOCK THEMES |
| 8 |
error_reporting(0); // - turn off error reporting |
| 9 |
get_header(); |
| 10 |
error_reporting(E_ALL); // - turn back on error reporting |
| 11 |
} else { |
| 12 |
// HANDLE HEADER FOR NON BLOCK THEMES |
| 13 |
get_header(); |
| 14 |
} |
| 15 |
|
| 16 |
?> |
| 17 |
|
| 18 |
<div id="main-content" class="main-content" style="background-color: transparent; flex-basis: 100% !important; "> |
| 19 |
<div id="primary" class="content-area" style="background-color: transparent; "> |
| 20 |
<div id="content" class="site-content" role="main" style="background-color: transparent;"> |
| 21 |
<?php while ( have_posts() ) : the_post(); // START THE LOOP |
| 22 |
if ( !has_shortcode( get_the_content(), 'scrollsequence' ) ) { |
| 23 |
// The content has a short code, so this check returned true. |
| 24 |
// echo '<h1>SHORTCODE WAS NOT THERE - ADDING IT</h1>'; |
| 25 |
echo do_shortcode( '[scrollsequence]' ); |
| 26 |
} |
| 27 |
the_content(); ?> |
| 28 |
<?php endwhile; ?> |
| 29 |
</div><!-- #content --> |
| 30 |
</div><!-- #primary --> |
| 31 |
</div><!-- #main-content --> |
| 32 |
|
| 33 |
<style> |
| 34 |
<?php // CHANGE BGCOLOR |
| 35 |
if ( !empty(carbon_get_post_meta( get_the_ID(), 'scrollsequence_bodybgcolor')) ){ ?> |
| 36 |
body.single-scrollsequence { |
| 37 |
background-color:<?php echo esc_attr( carbon_get_post_meta( get_the_ID(), 'scrollsequence_bodybgcolor') ); ?> ; |
| 38 |
} |
| 39 |
<?php }// CHANGE BGCOLOR ?> |
| 40 |
|
| 41 |
|
| 42 |
<?php // SHOW or HIDE FOOTER |
| 43 |
if ( empty(carbon_get_post_meta( get_the_ID(), 'scrollsequence_show_footer')) ) {?> |
| 44 |
footer { |
| 45 |
opacity:0; |
| 46 |
} |
| 47 |
<?php |
| 48 |
}else{ ?> |
| 49 |
footer{ |
| 50 |
position:relative; |
| 51 |
z-index:9999; |
| 52 |
} |
| 53 |
<?php |
| 54 |
}; |
| 55 |
?> |
| 56 |
|
| 57 |
</style> |
| 58 |
|
| 59 |
<?php |
| 60 |
if ( !empty(carbon_get_post_meta( get_the_ID(), 'scrollsequence_show_sidebar' ) )) : |
| 61 |
|
| 62 |
/* HANDLE SIDEBAR - since 1.3.2, to remove errors with FSE themes */ |
| 63 |
if ( function_exists('wp_is_block_theme') && wp_is_block_theme()){ |
| 64 |
error_reporting(0); // - turn off error reporting |
| 65 |
get_sidebar(); // Ak Todo Hide/Show sidebar |
| 66 |
error_reporting(E_ALL); // - turn back on error reporting |
| 67 |
} else { |
| 68 |
get_sidebar(); // Ak Todo Hide/Show sidebar |
| 69 |
} |
| 70 |
|
| 71 |
endif; |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
/* HANDLE FOOTER - since 1.3.2, to remove errors with FSE themes */ |
| 77 |
if ( function_exists('wp_is_block_theme') && wp_is_block_theme()){ |
| 78 |
// HANDLE FOOTER FOR BLOCK THEMES |
| 79 |
error_reporting(0); // - turn off error reporting |
| 80 |
get_footer(); |
| 81 |
error_reporting(E_ALL); // - turn back on error reporting |
| 82 |
} else { |
| 83 |
// HANDLE FOOTER FOR NON BLOCK THEMES |
| 84 |
get_footer(); |
| 85 |
} |
| 86 |
|