Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * This file creates the Projects Single Page
- *
- * @author Greg Rickaby
- * @since 1.0.0
- * @required Genesis
- */
- /*
- Template Name: Project
- */
- add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' ); // Force Full-Width Layout
- remove_action( 'genesis_loop', 'genesis_do_loop' ); // Remove default Genesis Loop
- add_action( 'genesis_loop', 'child_cpt_loop' ); // Add Custom Post Type Loop
- /**
- * Build the custom loop to display Projects
- *
- * @author Greg Rickaby
- * @since 1.0.0
- * @required Genesis
- */
- function child_cpt_loop() {
- $loop = new WP_Query( array( 'post_type' => 'project', 'posts_per_page' => 1 ) ); ?>
- <h1><?php the_title(); ?></h1>
- <div id="projects">
- <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
- <div id="post-<?php the_ID(); ?>" class="project">
- <p class="project-short-description"><?php echo genesis_get_custom_field( 'sfcpt_project_short_description' ); ?></p>
- <p class="project-description"><?php echo genesis_get_custom_field( 'sfcpt_project_description' ); ?></p>
- </div>
- <?php endwhile; ?>
- <?php }
- /** Finish loading the page */
- genesis();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement