Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Created July 15, 2014 23:57
Show Gist options
  • Save atwellpub/fc4f1a6064ccf016f2ea to your computer and use it in GitHub Desktop.
Save atwellpub/fc4f1a6064ccf016f2ea to your computer and use it in GitHub Desktop.
Example single-landing-pages.php file for integrating the landing-page custom post type with an active WordPress theme.
<?php get_header(); ?>
<?php $left_or_right = lp_get_value($post, 'default', 'sidebar'); ?>
<div id="main" class="container">
<?php if($left_or_right === "left") { ?>
<!-- SIDEBAR START -->
<section id="sidebar" class="grid one-third">
<?php lp_conversion_area(); /* Print out form content */ ?>
</section>
<!-- SIDEBAR END -->
<!-- CONTENT START -->
<section id="content" class="grid two-third">
<?php while ( have_posts() ) : the_post(); ?>
<div class="entry-content">
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
</section>
<!-- CONTENT END -->
<?php } else { ?>
<!-- CONTENT START -->
<section id="content" class="grid two-third">
<?php while ( have_posts() ) : the_post(); ?>
<div class="entry-content">
<h1><?php the_title(); ?></h1>
<?php the_content(); ?>
</div>
<?php endwhile; ?>
</section>
<!-- CONTENT END -->
<!-- SIDEBAR START -->
<section id="sidebar" class="grid one-third">
<?php lp_conversion_area(); /* Print out form content */ ?>
</section>
<!-- SIDEBAR END -->
<?php } ?>
</div>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment