Skip to main content
<?php
$prev_post = get_previous_post();
if($prev_post) {
   $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
   echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">&laquo; Previous post<br /><strong>&quot;'. $prev_title . '&quot;</strong></a>' . "\n";
                }

$next_post = get_next_post();
if($next_post) {
   $next_title = strip_tags(str_replace('"', '', $next_post->post_title));
   echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post &raquo;<br /><strong>&quot;'. $next_title . '&quot;</strong></a>' . "\n";
                }
?>
<?php
$prev_post = get_previous_post();
if($prev_post) {
   $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
   echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">&laquo; Previous post<br /><strong>&quot;'. $prev_title . '&quot;</strong></a>' . "\n";
                }

$next_post = get_next_post();
if($next_post) {
   $next_title = strip_tags(str_replace('"', '', $next_post->post_title));
   echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post &raquo;<br /><strong>&quot;'. $next_title . '&quot;</strong></a>' . "\n";
                }
?>
<?php
$prev_post = get_previous_post();
if($prev_post) {
   $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
   echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">&laquo; Previous post<br /><strong>&quot;'. $prev_title . '&quot;</strong></a>' . "\n";
}

$next_post = get_next_post();
if($next_post) {
   $next_title = strip_tags(str_replace('"', '', $next_post->post_title));
   echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post &raquo;<br /><strong>&quot;'. $next_title . '&quot;</strong></a>' . "\n";
}
?>
improved formatting
Source Link
tfrommen
  • 9.2k
  • 7
  • 39
  • 59
 <?php
$prev_post = get_previous_post();
if($prev_post) {
   $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
   echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">&laquo; Previous post<br /><strong>&quot;'. $prev_title . '&quot;</strong></a>' . "\n";
                }

$next_post = get_next_post();
if($next_post) {
   $next_title = strip_tags(str_replace('"', '', $next_post->post_title));
   echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post &raquo;<br /><strong>&quot;'. $next_title . '&quot;</strong></a>' . "\n";
                }
?>

$prev_post = get_previous_post(); if($prev_post) { $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title)); echo "\t" . 'ID) . '" title="' . $prev_title. '" class=" ">« Previous post
"'. $prev_title . '"' . "\n"; }

$next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . 'ID) . '" title="' . $next_title. '" class=" ">Next post »
"'. $next_title . '"' . "\n"; } ?>

 <?php

$prev_post = get_previous_post(); if($prev_post) { $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title)); echo "\t" . 'ID) . '" title="' . $prev_title. '" class=" ">« Previous post
"'. $prev_title . '"' . "\n"; }

$next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . 'ID) . '" title="' . $next_title. '" class=" ">Next post »
"'. $next_title . '"' . "\n"; } ?>

<?php
$prev_post = get_previous_post();
if($prev_post) {
   $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title));
   echo "\t" . '<a rel="prev" href="' . get_permalink($prev_post->ID) . '" title="' . $prev_title. '" class=" ">&laquo; Previous post<br /><strong>&quot;'. $prev_title . '&quot;</strong></a>' . "\n";
                }

$next_post = get_next_post();
if($next_post) {
   $next_title = strip_tags(str_replace('"', '', $next_post->post_title));
   echo "\t" . '<a rel="next" href="' . get_permalink($next_post->ID) . '" title="' . $next_title. '" class=" ">Next post &raquo;<br /><strong>&quot;'. $next_title . '&quot;</strong></a>' . "\n";
                }
?>
added 5 characters in body
Source Link
user25225
  • 331
  • 2
  • 3
post_title)); echo "\t" . 'ID) . '" title="' . $prev_title. '" class=" ">« Previous post
"'. $prev_title . '"' . "\n"; } $next_post = get_next_post();
 <?php
if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . 'ID) . '" title="' . $next_title. '" class=" ">Next post »
"'. $next_title . '"' . "\n"; }

$prev_post = get_previous_post(); if($prev_post) { $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title)); echo "\t" . 'ID) . '" title="' . $prev_title. '" class=" ">« Previous post
"'. $prev_title . '"' . "\n"; }

?>

$next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . 'ID) . '" title="' . $next_title. '" class=" ">Next post »
"'. $next_title . '"' . "\n"; } ?>

post_title)); echo "\t" . 'ID) . '" title="' . $prev_title. '" class=" ">« Previous post
"'. $prev_title . '"' . "\n"; } $next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . 'ID) . '" title="' . $next_title. '" class=" ">Next post »
"'. $next_title . '"' . "\n"; } ?>
 <?php

$prev_post = get_previous_post(); if($prev_post) { $prev_title = strip_tags(str_replace('"', '', $prev_post->post_title)); echo "\t" . 'ID) . '" title="' . $prev_title. '" class=" ">« Previous post
"'. $prev_title . '"' . "\n"; }

$next_post = get_next_post(); if($next_post) { $next_title = strip_tags(str_replace('"', '', $next_post->post_title)); echo "\t" . 'ID) . '" title="' . $next_title. '" class=" ">Next post »
"'. $next_title . '"' . "\n"; } ?>

Source Link
user25225
  • 331
  • 2
  • 3
Loading