Skip to content

Commit

Permalink
Added handling for code CPT in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
clarklab committed May 23, 2012
1 parent daeefc9 commit f259a01
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions content-single.php
Expand Up @@ -15,8 +15,14 @@
</header><!-- .entry-header -->

<div class="entry-content">
<?php if ('code' == get_post_type()) : // Wrap in pre if displaying snippets ?>
<pre name="code" class="php">
<?php echo get_the_content(); ?>
</pre>
<?php else : ?>
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
<?php endif; ?>
</div><!-- .entry-content -->

<footer class="entry-meta">
Expand Down
6 changes: 5 additions & 1 deletion content.php
Expand Up @@ -20,7 +20,11 @@
<div class="entry-summary">
<?php the_excerpt(); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<?php elseif ('code' == get_post_type()) : // Wrap in pre if displaying snippets ?>
<pre name="code" class="php">
<?php echo get_the_content(); ?>
</pre>
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', '_s' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', '_s' ), 'after' => '</div>' ) ); ?>
Expand Down
5 changes: 1 addition & 4 deletions style.css
Expand Up @@ -307,10 +307,7 @@ textarea {

/* Links */
a {
color: royalblue;
}
a:visited {
color: purple;
color:#4FACB2;
}
a:hover,
a:focus,
Expand Down

0 comments on commit f259a01

Please sign in to comment.