' . "\n";
if ($attachment) {
if (wp_attachment_is_image()) {
$attachments = get_children(array('post_type' => 'attachment', 'post_mime_type' => 'image', 'post_parent' => $parent_post->ID));
$count = count($attachments);
if ($count == 1) {
echo '
' . '' . esc_html__('Back to article', 'mh-magazine-lite') . '' . '';
} else {
previous_image_link('%link', '
' . esc_html__('Previous', 'mh-magazine-lite') . '');
}
} else {
echo '
' . '' . esc_html__('Back to article', 'mh-magazine-lite') . '' . '';
}
} else {
$prev_thumb = get_the_post_thumbnail($prev_post->ID, 'mh-magazine-lite-small');
previous_post_link('%link', $prev_thumb . '
' . esc_html__('Previous', 'mh-magazine-lite') . '' . '
%title
');
}
echo '
' . "\n";
}
if (!empty($next_post) || $attachment) {
echo '' . "\n";
if ($attachment) {
next_image_link('%link', '
' . esc_html__('Next', 'mh-magazine-lite') . '');
} else {
$next_thumb = get_the_post_thumbnail($next_post->ID, 'mh-magazine-lite-small');
next_post_link('%link', $next_thumb . '
' . esc_html__('Next', 'mh-magazine-lite') . '' . '
%title
');
}
echo '
' . "\n";
}
echo '