Skip to content

Instantly share code, notes, and snippets.

@aibrean
Last active August 29, 2015 14:06
Show Gist options
  • Save aibrean/3bdb72d9602270b4dff0 to your computer and use it in GitHub Desktop.
Save aibrean/3bdb72d9602270b4dff0 to your computer and use it in GitHub Desktop.
Asset Depot Plugin - Front-end display code.
<!--Use this file if you do not want any carousels to display -->
<?php if (have_rows('ad_page')){?>
<div class="well">Please note, carousel images will not be displayed in this view.</div>
<?php while (have_rows('ad_page')){ the_row(); ?>
<h2><?php the_sub_field('page_title'); ?></h2>
<h3><?php the_sub_field('page_description'); ?></h3>
<?php the_sub_field('page_content'); ?>
<?php }; ?>
<?php }; ?>
<!--Make sure you wrap your pages inside of a logged-in statement, so not everyone can see. Here are some examples -->
<?php if ( is_user_logged_in() ) {?>
<?php if (have_rows('ad_page')){?>
<div class="well">Please note, carousel images will not be displayed in this view.</div>
<?php while (have_rows('ad_page')){ the_row(); ?>
<h2><?php the_sub_field('page_title'); ?></h2>
<h3><?php the_sub_field('page_description'); ?></h3>
<?php the_sub_field('page_content'); ?>
<?php }; ?>
<?php }; ?>
<?php } else { ?>
You need to be logged in to view this content
<?php } ;?>
<!-- user is logged in and can edit posts, if you have other roles set for logged in users --> -->
<?php if ( is_user_logged_in() && current_user_can('edit_posts') ) {?>
<?php if (have_rows('ad_page')){?>
<div class="well">Please note, carousel images will not be displayed in this view.</div>
<?php while (have_rows('ad_page')){ the_row(); ?>
<h2><?php the_sub_field('page_title'); ?></h2>
<h3><?php the_sub_field('page_description'); ?></h3>
<?php the_sub_field('page_content'); ?>
<?php }; ?>
<?php }; ?>
<?php } else { ?>
You need to be logged in to view this content
<?php } ;?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment