0

Error message below:

Warning: Cannot modify header information - headers already sent by (output started at /home/content/79/7603579/html/listings/wp-content/themes/OIB theme/functions.php:519) in /home/content/79/7603579/html/listings/wp-includes/pluggable.php on line 897

EDIT: Code around functions.php line 519:

    <small><?php echo $value['desc']; ?></small>
    <div class="clearfix"></div>
    </div> 
    <?php break; 
case "section":
    $i++; ?>
    <div class="rm_section">
       <div class="rm_title">
         <h3><img src="<?php bloginfo('template_directory')?>/functions/images/trans.gif" class="inactive" alt="""><?php echo $value['name']; ?></h3>
         <span class="submit">
            <input name="save<?php echo $i; ?>" type="submit" value="Save changes" />
         </span>
         <div class="clearfix"></div>
      </div>
      <div class="rm_options">
    <?php break;
   } 
} ?>

And the fix, per comment below, removed this code:

function cpt_Search_category_Filter($query) {
   $post_type = array('post','business_sold');
   if ($query->is_search || $query->is_category) {
      $query->set('post_type', $post_type);
   };
      return $query;
};
add_filter('pre_get_posts','cpt_Search_category_Filter');
1
  • Can you show the code around line 519 of your functions.php?
    – Geert
    Commented May 12, 2011 at 14:46

1 Answer 1

1

Your functions.php file is outputting instead of returning something, on line 519.

Can you post whatever code/functions are around Line 519?

EDIT:

You have a syntax error in your cpt_Search_category_Filter() function. You have a couple stray semi-colons after closing braces.

Change this:

function cpt_Search_category_Filter($query) {
   $post_type = array('post','business_sold');
   if ($query->is_search || $query->is_category) {
      $query->set('post_type', $post_type);
   };
      return $query;
};
add_filter('pre_get_posts','cpt_Search_category_Filter');

to this:

function cpt_Search_category_Filter($query) {
   $post_type = array('post','business_sold');
   if ($query->is_search || $query->is_category) {
      $query->set('post_type', $post_type);
   }
      return $query;
}
add_filter('pre_get_posts','cpt_Search_category_Filter');
7
  • Hello! Now it's apparently causing login errors as well - here is the code around line 531:
    – mktggirl
    Commented May 12, 2011 at 17:02
  • <small><?php echo $value['desc']; ?></small><div class="clearfix"></div> </div> <?php break; case "section": $i++; ?> <div class="rm_section"> <div class="rm_title"><h3><img src="<?php bloginfo('template_directory')?>/functions/images/trans.gif" class="inactive" alt="""><?php echo $value['name']; ?></h3><span class="submit"><input name="save<?php echo $i; ?>" type="submit" value="Save changes" /> </span><div class="clearfix"></div></div> <div class="rm_options"> <?php break; } } ?>
    – mktggirl
    Commented May 12, 2011 at 17:03
  • I apologize - the code I posted isn't formatted. I'm still scrambling to find a way to reasonably post code here. I'll keep working on it. I so appreciate your effort to help me.
    – mktggirl
    Commented May 12, 2011 at 17:39
  • Hello again~ This following fix added to function.php is apparently what was causing the error in function.php. I removed so now the system is not recognizing the assignment of the inherent/default (per plugin Custom Post UI) taxonomony of 'categories' (and tags) to my custom post type. The plugin does not assign. function cpt_Search_category_Filter($query) { $post_type = array('post','business_sold'); if ($query->is_search || $query->is_category) { $query->set('post_type', $post_type); }; return $query;};add_filter('pre_get_posts','cpt_Search_category_Filter');
    – mktggirl
    Commented May 12, 2011 at 19:58
  • The best approach would probably be to edit your original question, and post the code there. :) Commented May 12, 2011 at 20:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.