Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @package WordPress
- * @subpackage Default_Theme
- * Template Name: Page
- */
- get_header(); ?>
- <?php
- global $post;
- if ( post_password_required( $post ) ) {
- ?>
- <?php $fields = get_acf(); ?>
- <script type="text/javascript">
- (function() {
- window.onload = function() {
- ...
- }}
- )
- </script>
- <div id="map"></div>
- <?php } else { ?>
- Not passworded
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <?
- } // Page isn't password-protected
- ?>
- <?php get_footer(); ?>
- <?php
- /**
- * Template: Password-Protected
- */
- ?>
- <?php
- /**
- * Template: Password-Protected
- */
- ?>
- <?php get_header(); ?>
- <div id="main">
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <div id="map" style="width:100%; height:100%"></div>
- <?php endwhile; ?>
- <?php endif; ?>
- </div>
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
- <?php
- /**
- * Template: Password-Protected
- */
- ?>
- <?php get_header(); ?>
- <div id="main">
- <?php
- // Globalize $post
- global $post;
- // Test for password-protected page
- // Returns true if post is password-protected
- // and if the password doesn't match cookie
- if ( post_password_required( $post ) ) {
- ?>
- <p>
- CUSTOM CONTENT THAT DISPLAYS ONLY WHEN PAGE IS PASSWORD PROTECTED
- GOES HERE
- </p>
- <?php
- } else {
- // Page isn't password-protected
- ?>
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <div id="map" style="width:100%; height:100%"></div>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php } ?>
- </div>
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
- <?php
- /**
- * Template: Login-Required
- */
- ?>
- <?php get_header(); ?>
- <div id="main">
- <?php
- // Globalize $post
- global $post;
- // Test for password-protected page
- // Returns true if post is password-protected
- // and if the password doesn't match cookie
- if ( ! is_user_logged_in() ) {
- ?>
- <p>
- CUSTOM CONTENT THAT DISPLAYS ONLY WHEN USER IS NOT LOGGED IN
- GOES HERE
- </p>
- <?php
- } else {
- // Page isn't password-protected
- ?>
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <div id="map" style="width:100%; height:100%"></div>
- <?php endwhile; ?>
- <?php endif; ?>
- <?php } ?>
- </div>
- <?php get_sidebar(); ?>
- <?php get_footer(); ?>
- <?php
- global $post;
- if ( post_password_required( $post ) ) {
- ?>
- <?php $fields = get_acf(); ?>
- <script type="text/javascript">
- (function() {
- window.onload = function() {
- ...
- }}
- )
- </script>
- <div id="map"></div>
- <?php
- /**
- * @package WordPress
- * @subpackage Default_Theme
- * Template Name: Page
- */
- get_header(); ?>
- <?php
- global $post;
- if ( post_password_required( $post ) ) {
- ?>
- <p>THIS POST IS PASSWORD PROTECTED. PLEASE ENTER THE PASSWORD TO VIEW THIS POST.</p>
- <?php
- } else {
- // No password required, or password has been entered
- ?>
- <?php $fields = get_acf(); ?>
- <script type="text/javascript">
- (function() {
- window.onload = function() {
- ...
- }}
- )
- </script>
- <div id="map"></div>
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <?
- } // Page isn't password-protected
- ?>
- <?php get_footer(); ?>
- <?php
- /**
- * @package WordPress
- * @subpackage Default_Theme
- * Template Name: Page
- */
- get_header(); ?>
- <?php
- global $post;
- if ( post_password_required( $post ) ) {
- ?>
- <p>THIS POST IS PASSWORD PROTECTED. PLEASE ENTER THE PASSWORD TO VIEW THIS POST.</p>
- <?php echo get_the_password_form(); ?>
- <?php
- } else {
- // No password required, or password has been entered
- ?>
- <?php $fields = get_acf(); ?>
- <script type="text/javascript">
- (function() {
- window.onload = function() {
- ...
- }}
- )
- </script>
- <div id="map"></div>
- <?php if (have_posts()) : ?>
- <?php while (have_posts()) : the_post(); ?>
- <?php endwhile; ?>
- <?php endif; ?>
- <?
- } // Page isn't password-protected
- ?>
- <?php get_footer(); ?>
- global $post;
- if ( ! post_password_required( $post ) ) {
- // protected content
- } else {
- echo get_the_password_form();
- }
- <?php
- /**
- * Template Name: Password-Protected
- */
- ?>
Add Comment
Please, Sign In to add comment