title: functions.php causes header error in Wordpress
body: <p>I have a problem with my wordpress theme, the functions.php file ouputs ome bad header error:</p>
  
  <blockquote>
    <p>Warning: Cannot modify header information - headers already sent by (output started at /home/slavisap/public_html/femarkets/wordpress/wp-content/themes/Flex E/functions.php:67) in /home/slavisap/public_html/femarkets/wordpress/wp-includes/pluggable.php on line 934</p>
  </blockquote>
  
  <p>It happens randomly, when I try to visit some page or create another one from admin.</p>
  
  <p>this is my functions.php:</p>
  
  <pre><code>&lt;?php
  if (function_exists('register_nav_menus')) {
      register_nav_menus(
              array(
                  'primary' =&gt; 'Primary Header Nav',
                  'footer_menu' =&gt; 'Footer Menu',
                  'exploring' =&gt; 'Exploring Page Menu',
                  'using' =&gt; 'Using Page Menu',
                  'downloading' =&gt; 'Downloading Page Menu'
              )
      );
  }
  function get_breadcrumbs() {
      global $wp_query;
  
      if (!is_home()) {
  
          // Start the UL
          echo '&lt;ul class="breadcrumbs"&gt;';
          // Add the Home link
          echo '&lt;li&gt;&lt;a href="' . get_settings('home') . '"&gt;' . get_bloginfo('name') . '&lt;/a&gt;&lt;/li&gt;';
  
          if (is_category()) {
              $catTitle = single_cat_title("", false);
              $cat = get_cat_ID($catTitle);
              echo "&lt;li&gt; &amp;#47; " . get_category_parents($cat, TRUE, " &amp;#47; ") . "&lt;/li&gt;";
          } elseif (is_archive() &amp;&amp; !is_category()) {
              echo "&lt;li&gt; &amp;#47; Archives&lt;/li&gt;";
          } elseif (is_search()) {
  
              echo "&lt;li&gt; &amp;#47; Search Results&lt;/li&gt;";
          } elseif (is_404()) {
              echo "&lt;li&gt; &amp;#47; 404 Not Found&lt;/li&gt;";
          } elseif (is_single()) {
              $category = get_the_category();
              $category_id = get_cat_ID($category[0]-&gt;cat_name);
  
              echo '&lt;li&gt; &amp;#47; ' . get_category_parents($category_id, TRUE, " &amp;#47; ");
              echo the_title('', '', FALSE) . "&lt;/li&gt;";
          } elseif (is_page()) {
              $post = $wp_query-&gt;get_queried_object();
  
              if ($post-&gt;post_parent == 0) {
  
                  echo "&lt;li&gt; &amp;#47; " . the_title('', '', FALSE) . "&lt;/li&gt;";
              } else {
                  $title = the_title('', '', FALSE);
                  $ancestors = array_reverse(get_post_ancestors($post-&gt;ID));
                  array_push($ancestors, $post-&gt;ID);
  
                  foreach ($ancestors as $ancestor) {
                      if ($ancestor != end($ancestors)) {
                          echo '&lt;li&gt; &amp;raquo; &lt;a href="' . get_permalink($ancestor) . '"&gt;' . strip_tags(apply_filters('single_post_title', get_the_title($ancestor))) . '&lt;/a&gt;&lt;/li&gt;';
                      } else {
                          echo '&lt;li&gt; &amp;raquo; ' . strip_tags(apply_filters('single_post_title', get_the_title($ancestor))) . '&lt;/li&gt;';
                      }
                  }
              }
          }
  
          // End the UL
          echo "&lt;/ul&gt;";
      }
  }
  ?&gt;
  </code></pre>
  
  <p>my website URL: <a href="http://slavisaperisic.com/femarkets/wordpress/" rel="nofollow">http://slavisaperisic.com/femarkets/wordpress/</a></p>
  
  <p>do you know what I'm doing wrong?</p>