Add members only template (unfinished)
authorLaury GvR <laury@gaslightmedia.com>
Tue, 14 May 2019 18:51:29 +0000 (14:51 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 14 May 2019 18:51:29 +0000 (14:51 -0400)
members-only-template.php [new file with mode: 0644]

diff --git a/members-only-template.php b/members-only-template.php
new file mode 100644 (file)
index 0000000..cf18a12
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+/**
+ * Members Only Template.
+ *
+ * @package Avada
+ * @subpackage Templates
+ */
+
+// Do not allow directly accessing this file.
+if ( ! defined( 'ABSPATH' ) ) {
+       exit( 'Direct script access denied.' );
+}
+?>
+<?php get_header(); ?>
+
+<?php if ( 0 >= avada_number_of_featured_images() && !has_post_thumbnail()) { ?>
+       <div id="featured-image"
+               style="<?php echo 'background-image: url('.get_template_directory_uri().'/assets/images/default-header.jpg);height:0;padding:0;padding-bottom:20%;width:100%;background-position:center center;background-size: 100%;background-repeat:no-repeat;max-height: 300px;'?>"
+               class="post-slideshow">
+       </div>
+<?php } ?>
+</div>
+<section id="content" <?php Avada()->layout->add_style( 'content_style' ); ?>>
+       <?php while ( have_posts() ) : ?>
+               <?php the_post(); ?>
+               <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
+                       <?php echo fusion_render_rich_snippets_for_pages(); // WPCS: XSS ok. ?>
+                       <?php avada_featured_images_for_pages(); ?>
+                       <div class="post-content">
+
+                               <?php the_content(); ?>
+                               <?php fusion_link_pages(); ?>
+                       </div>
+                       <?php if ( ! post_password_required( $post->ID ) ) : ?>
+                               <?php do_action( 'avada_before_additional_page_content' ); ?>
+                               <?php do_action( 'avada_after_additional_page_content' ); ?>
+                       <?php endif; // Password check. ?>
+               </div>
+       <?php endwhile; ?>
+       <?php wp_reset_postdata(); ?>
+</section>
+<?php do_action( 'avada_after_content' ); ?>
+<?php
+get_footer();
+
+/* Omit closing PHP tag to avoid "Headers already sent" issues. */