Skip to content

Instantly share code, notes, and snippets.

@susanlangenes
Last active February 2, 2016 22:52
Show Gist options
  • Save susanlangenes/739d401c65749dd67308 to your computer and use it in GitHub Desktop.
Save susanlangenes/739d401c65749dd67308 to your computer and use it in GitHub Desktop.
<?php
/**
* Template Name: Civi Form Page
*
* 1/3, 2/3 page template
*
* @package MRG Theme
*/
get_header(); ?>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
<p class="intro-text"><?php echo the_field('intro_text'); ?></p>
</header><!-- .entry-header -->
<?php if( get_field('left_third_content') ): // if we can find this field, we're using content from page-civiform.php
?>
<div id="primary" class="content-area">
<div class="left-third">
<?php echo the_field('left_third_content'); //this is an ACF WYSIWYG editor field
?>
</div>
<main id="main" class="site-main shortcoded" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); // site admins use native WP page content editor to insert shortcode
?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php else: // if we can't find 'left_third_content', we must be on a Civi-generated page; don't include div.left-third as it will be empty
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', 'page' ); ?>
<?php endwhile; // end of the loop. ?>
</main><!-- #main -->
</div><!-- #primary -->
<?php endif; ?>
<?php get_footer(); ?>
@susanlangenes
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment