WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Coding problem

[Resolved] Coding problem

  • Can anyone help me fix this chunk of code that I have in my single.php file? I’m no php guru, but I can’t see why it’s causing a blank page to be returned.

    $current_category = single_cat_title("", false);
      $category = get_category($current_category);
      $cat_slug = $category->slug;
    
      if ($cat_slug == "wolves-in-sheeps-clothing" || $cat_slug == "fruit-that-remains") {
        $my_post_type = "chapter";
        $my_category_type = "this booklet";
      }
      else {
        $my_post_type = "post";
        $my_category_type = "this category";
    ?>
            <div id="post-navigation">
    					<div class="nav-previous"><?php previous_post_link('%link', 'Previous ' . $my_post_type . ' in ' .  $my_category_type, TRUE); ?></div>
    					<div class="nav-next"><?php next_post_link('%link', 'Next ' . $my_post_type . ' in ' .  $my_category_type, TRUE); ?></div>
    				</div>

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Coding problem’ is closed to new replies.
Skip to toolbar