Hi,
I found that if you put the code into your “functions.php” through the panel “Appearance > Editor”, it breaks the code. I recommend you to edit the “functions.php” via FTP instead.
Alternatively, you can use a different syntax for the PHP condition to prevent this error:
function happenstance_content_nav( $html_id ) {
global $wp_query;
$html_id = esc_attr( $html_id );
if ( $wp_query->max_num_pages > 1 ) { ?>
<div id="<?php echo $html_id; ?>" class="navigation" role="navigation">
<div class="navigation-inner">
<h2 class="navigation-headline section-heading"><?php _e( 'Post navigation', 'happenstance' ); ?></h2>
<div class="nav-wrapper">
<p class="navigation-links">
<?php $big = 999999999;
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'prev_text' => __( '← Previous', 'happenstance' ),
'next_text' => __( 'Next →', 'happenstance' ),
'total' => $wp_query->max_num_pages,
'show_all' => true,
'add_args' => false
) );
?>
</p>
</div>
</div>
</div>
<?php }
}
Best regards,
Tomas Toman