breaking out page content into partials
This commit is contained in:
parent
4a15725d3f
commit
5ea778d8f2
55
index.php
55
index.php
@ -15,34 +15,7 @@
|
|||||||
|
|
||||||
<div id="content" class="narrowcolumn">
|
<div id="content" class="narrowcolumn">
|
||||||
|
|
||||||
<?php if (!is_paged()) { ?>
|
<?php if (!is_paged()) { include(dirname(__FILE__) . '/partials/index-comic-post.inc'); } ?>
|
||||||
<div class="post-comic-head"></div>
|
|
||||||
<div class="post-comic">
|
|
||||||
<?php include(dirname(__FILE__) . '/partials/nav.inc') ?>
|
|
||||||
<div class="comicdate">
|
|
||||||
<?php the_date('F jS, Y') ?>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
|
|
||||||
<ul class="storyline-cats"><li class="storyline-root"><?php the_category(' » </li><li>', multiple) ?></li></ul>
|
|
||||||
<?php } ?>
|
|
||||||
<h2>
|
|
||||||
<a href="<?php get_permalink($last_comic_post->ID) ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'comicpress'), get_the_title()) ?>"><?php the_title() ?></a>
|
|
||||||
</h2>
|
|
||||||
<div class="entry">
|
|
||||||
<?php the_content('↓ Read the rest of this entry...') ?>
|
|
||||||
</div>
|
|
||||||
<?php the_transcript('styled') ?>
|
|
||||||
<div class="tags">
|
|
||||||
<?php the_tags('└ Tags: ', ', ', ''); edit_post_link('Edit Post', ' [ ', ' ] ') ?>
|
|
||||||
</div>
|
|
||||||
<div class="comment-link">
|
|
||||||
<?php if ('open' == $post->comment_status) { comments_popup_link('“Comment”', '“1 Comment”', '“% Comments”'); } ?>
|
|
||||||
</div>
|
|
||||||
<br class="clear-margins" />
|
|
||||||
</div>
|
|
||||||
<div class="post-comic-foot"></div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<div id="blogheader"><!-- This area can be used for a heading above your main page blog posts --></div>
|
<div id="blogheader"><!-- This area can be used for a heading above your main page blog posts --></div>
|
||||||
|
|
||||||
@ -58,28 +31,10 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
while ($wp_query->have_posts()) {
|
while ($wp_query->have_posts()) {
|
||||||
$wp_query->the_post() ?>
|
$wp_query->the_post();
|
||||||
<div class="post-head"></div>
|
include(dirname(__FILE__) . '/partials/index-blog-post.inc');
|
||||||
<div class="post" id="post-<?php the_ID() ?>">
|
}
|
||||||
<h3>
|
?>
|
||||||
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'comicpress'), get_the_title()) ?>"><?php the_title() ?></a>
|
|
||||||
</h3>
|
|
||||||
<div class="postdate">
|
|
||||||
<?php the_time('F jS, Y') ?>
|
|
||||||
</div>
|
|
||||||
<div class="entry">
|
|
||||||
<?php the_content(__('↓ Read the rest of this entry...', 'comicpress')) ?>
|
|
||||||
</div>
|
|
||||||
<div class="tags">
|
|
||||||
<?php the_tags(__('└ Tags: ', 'comicpress'), ', ', ''); edit_post_link(__('Edit Post', 'comicpress'), ' [ ', ' ] ') ?>
|
|
||||||
</div>
|
|
||||||
<div class="comment-link">
|
|
||||||
<?php if ('open' == $post->comment_status) { comments_popup_link(__('“Comment”', 'comicpress'), __('“1 Comment”', 'comicpress'), __('“% Comments”', 'comicpress')); } ?>
|
|
||||||
</div>
|
|
||||||
<div class="clear-margins"><br /></div>
|
|
||||||
</div>
|
|
||||||
<div class="post-foot"></div>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<div class="pagenav">
|
<div class="pagenav">
|
||||||
<div class="pagenav-right"><?php previous_posts_link(__('Newer Entries ↑', 'comicpress')) ?></div>
|
<div class="pagenav-right"><?php previous_posts_link(__('Newer Entries ↑', 'comicpress')) ?></div>
|
||||||
|
20
partials/index-blog-post.inc
Normal file
20
partials/index-blog-post.inc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<div class="post-head"></div>
|
||||||
|
<div class="post" id="post-<?php the_ID() ?>">
|
||||||
|
<h3>
|
||||||
|
<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'comicpress'), get_the_title()) ?>"><?php the_title() ?></a>
|
||||||
|
</h3>
|
||||||
|
<div class="postdate">
|
||||||
|
<?php the_time('F jS, Y') ?>
|
||||||
|
</div>
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content(__('↓ Read the rest of this entry...', 'comicpress')) ?>
|
||||||
|
</div>
|
||||||
|
<div class="tags">
|
||||||
|
<?php the_tags(__('└ Tags: ', 'comicpress'), ', ', ''); edit_post_link(__('Edit Post', 'comicpress'), ' [ ', ' ] ') ?>
|
||||||
|
</div>
|
||||||
|
<div class="comment-link">
|
||||||
|
<?php if ('open' == $post->comment_status) { comments_popup_link(__('“Comment”', 'comicpress'), __('“1 Comment”', 'comicpress'), __('“% Comments”', 'comicpress')); } ?>
|
||||||
|
</div>
|
||||||
|
<div class="clear-margins"><br /></div>
|
||||||
|
</div>
|
||||||
|
<div class="post-foot"></div>
|
26
partials/index-comic-post.inc
Normal file
26
partials/index-comic-post.inc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<div class="post-comic-head"></div>
|
||||||
|
<div class="post-comic">
|
||||||
|
<?php include('nav.inc') ?>
|
||||||
|
<div class="comicdate">
|
||||||
|
<?php the_date('F jS, Y') ?>
|
||||||
|
</div>
|
||||||
|
<div class="clear"></div>
|
||||||
|
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
|
||||||
|
<ul class="storyline-cats"><li class="storyline-root"><?php the_category(' » </li><li>', multiple) ?></li></ul>
|
||||||
|
<?php } ?>
|
||||||
|
<h2>
|
||||||
|
<a href="<?php get_permalink($last_comic_post->ID) ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s', 'comicpress'), get_the_title()) ?>"><?php the_title() ?></a>
|
||||||
|
</h2>
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content('↓ Read the rest of this entry...') ?>
|
||||||
|
</div>
|
||||||
|
<?php the_transcript('styled') ?>
|
||||||
|
<div class="tags">
|
||||||
|
<?php the_tags('└ Tags: ', ', ', ''); edit_post_link('Edit Post', ' [ ', ' ] ') ?>
|
||||||
|
</div>
|
||||||
|
<div class="comment-link">
|
||||||
|
<?php if ('open' == $post->comment_status) { comments_popup_link('“Comment”', '“1 Comment”', '“% Comments”'); } ?>
|
||||||
|
</div>
|
||||||
|
<br class="clear-margins" />
|
||||||
|
</div>
|
||||||
|
<div class="post-comic-foot"></div>
|
26
partials/nav.inc
Normal file
26
partials/nav.inc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<div class="nav">
|
||||||
|
<?php if ($nav_comics['show_first']) { ?>
|
||||||
|
<div class="nav-first">
|
||||||
|
<a href="<?php echo get_permalink($nav_comics['first']->ID) ?>"
|
||||||
|
title="<?php _e('Go to the first comic', 'comicpress') ?>">‹‹ <?php _e('First', 'comicpress') ?></a>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ($nav_comics['show_previous']) { ?>
|
||||||
|
<div class="nav-previous">
|
||||||
|
<a href="<?php echo get_permalink($nav_comics['previous']->ID) ?>"
|
||||||
|
title="<?php _e('Go to the previous comic', 'comicpress') ?>">‹ <?php _e('Previous', 'comicpress') ?></a>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ($nav_comics['show_next']) { ?>
|
||||||
|
<div class="nav-first">
|
||||||
|
<a href="<?php echo get_permalink($nav_comics['next']->ID) ?>"
|
||||||
|
title="<?php _e('Go to the next comic', 'comicpress') ?>"><?php _e('Next', 'comicpress') ?> ›</a>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
<?php if ($nav_comics['show_last']) { ?>
|
||||||
|
<div class="nav-previous">
|
||||||
|
<a href="<?php echo get_permalink($nav_comics['last']->ID) ?>"
|
||||||
|
title="<?php _e('Go to the last comic', 'comicpress') ?>"><?php _e('Last', 'comicpress') ?> ››</a>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
</div>
|
20
partials/single-blog-post.inc
Normal file
20
partials/single-blog-post.inc
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<div class="post-head"></div>
|
||||||
|
<div class="post" id="post-<?php the_ID() ?>">
|
||||||
|
<div class="nav-blog">
|
||||||
|
<div class="nav-blog-previous"><?php previous_post_link('%link','‹ Previous', TRUE) ?></div>
|
||||||
|
<div class="nav-blog-next"><?php next_post_link('%link','Next ›', TRUE) ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="clear"></div>
|
||||||
|
<h2><?php the_title() ?></h2>
|
||||||
|
<div class="postdate"><?php the_time('F jS, Y') ?></div>
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content() ?>
|
||||||
|
<?php the_transcript('styled') ?>
|
||||||
|
<div class="tags">
|
||||||
|
<?php the_tags('└ Tags: ', ', ', ''); edit_post_link('Edit Post', ' [ ', ' ] ') ?>
|
||||||
|
</div>
|
||||||
|
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')) ?>
|
||||||
|
</div>
|
||||||
|
<br class="clear-margins" />
|
||||||
|
</div>
|
||||||
|
<div class="post-foot"></div>
|
21
partials/single-comic-post.inc
Normal file
21
partials/single-comic-post.inc
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<div class="post-comic-head"></div>
|
||||||
|
<div class="post-comic" id="post-<?php the_ID() ?>">
|
||||||
|
<div class="comicdate">
|
||||||
|
<?php include('nav.inc') ?>
|
||||||
|
<?php the_time('F jS, Y') ?>
|
||||||
|
</div>
|
||||||
|
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
|
||||||
|
<ul class="storyline-cats"><li class="storyline-root"><?php the_category(' » </li><li>', 'multiple') ?></li></ul>
|
||||||
|
<?php } ?>
|
||||||
|
<h2><?php the_title() ?></h2>
|
||||||
|
<div class="entry">
|
||||||
|
<?php the_content() ?>
|
||||||
|
<?php the_transcript('styled') ?>
|
||||||
|
<div class="tags">
|
||||||
|
<?php the_tags('└ Tags: ', ', ', ''); edit_post_link('Edit Post', ' [ ', ' ] ') ?>
|
||||||
|
</div>
|
||||||
|
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')) ?>
|
||||||
|
</div>
|
||||||
|
<br class="clear-margins" />
|
||||||
|
</div>
|
||||||
|
<div class="post-comic-foot"></div>
|
78
single.php
78
single.php
@ -17,68 +17,26 @@
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<div id="content" class="narrowcolumn">
|
<div id="content" class="narrowcolumn">
|
||||||
<?php if (have_posts()) { ?>
|
<?php
|
||||||
<?php while (have_posts()) { the_post() ?>
|
if (have_posts()) {
|
||||||
<?php if (in_comic_category()) { ?>
|
while (have_posts()) { the_post();
|
||||||
<div class="post-comic-head"></div>
|
if (in_comic_category()) {
|
||||||
<div class="post-comic" id="post-<?php the_ID() ?>">
|
include(dirname(__FILE__) . '/partials/single-comic-post.inc');
|
||||||
<div class="comicdate">
|
} else {
|
||||||
<?php include(dirname(__FILE__) . '/partials/nav.inc') ?>
|
include(dirname(__FILE_) . '/partials/single-blog-post.inc');
|
||||||
<?php the_time('F jS, Y') ?>
|
}
|
||||||
</div>
|
|
||||||
<?php if (get_option('comicpress-enable-storyline-support') == 1) { ?>
|
|
||||||
<ul class="storyline-cats"><li class="storyline-root"><?php the_category(' » </li><li>', 'multiple') ?></li></ul>
|
|
||||||
<?php } ?>
|
|
||||||
<h2><?php the_title() ?></h2>
|
|
||||||
<div class="entry">
|
|
||||||
<?php the_content() ?>
|
|
||||||
<?php the_transcript('styled') ?>
|
|
||||||
<div class="tags">
|
|
||||||
<?php the_tags('└ Tags: ', ', ', ''); edit_post_link('Edit Post', ' [ ', ' ] ') ?>
|
|
||||||
</div>
|
|
||||||
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')) ?>
|
|
||||||
</div>
|
|
||||||
<br class="clear-margins" />
|
|
||||||
</div>
|
|
||||||
<div class="post-comic-foot"></div>
|
|
||||||
<?php } else { ?>
|
|
||||||
<div class="post-head"></div>
|
|
||||||
<div class="post" id="post-<?php the_ID() ?>">
|
|
||||||
<div class="nav-blog">
|
|
||||||
<div class="nav-blog-previous"><?php previous_post_link('%link','‹ Previous', TRUE) ?></div>
|
|
||||||
<div class="nav-blog-next"><?php next_post_link('%link','Next ›', TRUE) ?></div>
|
|
||||||
</div>
|
|
||||||
<div class="clear"></div>
|
|
||||||
<h2><?php the_title() ?></h2>
|
|
||||||
<div class="postdate"><?php the_time('F jS, Y') ?></div>
|
|
||||||
<div class="entry">
|
|
||||||
<?php the_content() ?>
|
|
||||||
<?php the_transcript('styled') ?>
|
|
||||||
<div class="tags">
|
|
||||||
<?php the_tags('└ Tags: ', ', ', ''); edit_post_link('Edit Post', ' [ ', ' ] ') ?>
|
|
||||||
</div>
|
|
||||||
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')) ?>
|
|
||||||
</div>
|
|
||||||
<br class="clear-margins" />
|
|
||||||
</div>
|
|
||||||
<div class="post-foot"></div>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
<?php comments_template() ?>
|
|
||||||
|
|
||||||
|
comments_template();
|
||||||
|
}
|
||||||
|
} else { ?>
|
||||||
|
<div class="post-head"></div>
|
||||||
|
<div class="post">
|
||||||
|
<p>Sorry, no posts matched your criteria.</p>
|
||||||
|
<br class="clear-margins" />
|
||||||
|
</div>
|
||||||
|
<div class="post-foot"></div>
|
||||||
<?php }
|
<?php }
|
||||||
} else { ?>
|
?>
|
||||||
|
|
||||||
<div class="post-head"></div>
|
|
||||||
<div class="post">
|
|
||||||
<p>Sorry, no posts matched your criteria.</p>
|
|
||||||
<br class="clear-margins" />
|
|
||||||
</div>
|
|
||||||
<div class="post-foot"></div>
|
|
||||||
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include(TEMPLATEPATH . '/sidebar.php') ?>
|
<?php include(TEMPLATEPATH . '/sidebar.php') ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user