Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created April 5, 2012 17:43
Show Gist options
  • Save billerickson/2312784 to your computer and use it in GitHub Desktop.
Save billerickson/2312784 to your computer and use it in GitHub Desktop.
<?php
/**
* The template used for displaying page content in page.php
*
* @package WordPress
* @subpackage Twenty_Eleven
* @since Twenty Eleven 1.0
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
// Get the meta field 'be_location' for the current page
global $post;
$location = get_post_meta( $post->ID, 'be_location', true );
// If it isn't empty, escape it (to ensure safe characters are used) and display the result.
if( !empty( $location ) )
echo '<p>Location: ' . esc_attr( $location ) . '</p>';
?>
<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment