';
// previous post
$prev_post = get_adjacent_post( true, '', true, 'category');
if ( is_a( $prev_post, 'WP_Post' ) ) {
$post_address = get_permalink( $prev_post->ID );
$output .= '
';
$output .= '
';
$output .= '
';
if(is_singular( 'post' )) {
$category = get_the_category($prev_post->ID);
$output .= $category[0]->cat_name;
}
$output .= '
';
$working_post_content = $prev_post->post_content;
//$essb_post_og_desc = strip_shortcodes($essb_post_og_desc);
$post_shortdesc = $prev_post->post_excerpt;
if ($post_shortdesc != '') {
$working_post_content = $post_shortdesc;
}
$working_post_content = strip_tags ( $working_post_content );
$working_post_content = preg_replace( '/\s+/', ' ', $working_post_content );
$working_post_content = strip_shortcodes($working_post_content);
$working_post_content = trim ( $working_post_content );
$working_post_content = substr ( $working_post_content, 0, 150 );
$working_post_content .= '…';
$output .= '
';
$output .= '
'.$working_post_content.'';
$output .= '
';
$output .= '
';
}
// next post
$next_post = get_adjacent_post( true, '', false, 'category');
if ( is_a( $next_post, 'WP_Post' ) ) {
$post_address = get_permalink( $next_post->ID );
$output .= '
';
$output .= '
';
$output .= '
';
if(is_singular( 'post' )) {
$category = get_the_category($next_post->ID);
$output .= $category[0]->cat_name;
}
$output .= '
';
$working_post_content = $next_post->post_content;
//$essb_post_og_desc = strip_shortcodes($essb_post_og_desc);
$post_shortdesc = $next_post->post_excerpt;
if ($post_shortdesc != '') {
$working_post_content = $post_shortdesc;
}
$working_post_content = strip_tags ( $working_post_content );
$working_post_content = preg_replace( '/\s+/', ' ', $working_post_content );
$working_post_content = strip_shortcodes($working_post_content);
$working_post_content = trim ( $working_post_content );
$working_post_content = substr ( $working_post_content, 0, 150 );
$working_post_content .= '…';
$output .= '
';
$output .= '
'.$working_post_content.'';
$output .= '
';
$output .= '