Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<div class="container">
<div id="primary">
<div id="content">
<?php
$pp404 = false;
// instead of is_404() you'll probably use another code to identify a 404 error
// if PP_404 is defined the 404page plugin is active
// if pp_404_is_active() returns true a custom 404 page is selected and exists ?>
if ( is_404() && defined( 'PP_404' ) && pp_404_is_active() ) {
pp_404_set_native_support();
$pp404 = true;
}
?>
<?php // using a do while loop ensures that the loop is exuted at least once even if there are no posts ?>
<?php do { ?>
<?php if ( !$pp404 ) { the_post(); } ?>
<article class="post">
<h1 class="title"><?php if ( $pp404 ) { pp_404_the_title(); } else { the_title(); } ?></h1>
<div class="the-content">
<?php if ( $pp404 ) { pp_404_the_content(); } else { the_content(); } ?>
<?php if ( ! $pp404 ) { wp_link_pages(); } ?>
</div>
<article>
<?php } while ( have_posts() ); ?>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.