Title: Adding theme support for post formats &#8211; I get some errors
Last modified: August 30, 2016

---

# Adding theme support for post formats – I get some errors

 *  Resolved [vtinath](https://wordpress.org/support/users/vtinath/)
 * (@vtinath)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/adding-theme-support-for-post-formats-i-get-some-errors/)
 * Hi,
    I’ve been trying to get wordpress to offer me the option between “standard”
   and “link” posts.
 * I’m using my own custom theme, not based on any default one.
 * I managed to get it working in my category template using advice from [this thread](https://wordpress.org/support/topic/how-to-make-use-of-the-post-format-link).
   Yay.
 * But, in order to be able to select a post format in the admin panel, as I understand,
   I also need to add
 *     ```
       <?php add_theme_support( 'post-formats', array( 'standard', 'link' ) ); ?>
       ```
   
 * to **functions.php**.
 * This works, BUT, with errors. It shows me the option to select between “link”
   and “standard” formats, but when I save the post, I get this error:
 * > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/public_html/wp-content/themes/2015/functions.php:3) in /home/
   > public_html/wp-admin/post.php on line 237
   > Warning: Cannot modify header information – headers already sent by (output
   > started at /home/public_html/wp-content/themes/2015/functions.php:3) in /home/
   > public_html/wp-includes/pluggable.php on line 1196
 * The post gets saved correctly in spite of the error, but it is annoying to keep
   getting it on every content update.
 * Is there something else I need to do to get this working right?
    I have read 
   about [post formats](https://codex.wordpress.org/Post_Formats) and [adding theme support](https://codex.wordpress.org/Function_Reference/add_theme_support)
   in the codex but I’m none the wiser.
 * Here’s my functions.php:
    [http://pastebin.com/yrXZUqKD](http://pastebin.com/yrXZUqKD)
 * Any help appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [catacaustic](https://wordpress.org/support/users/catacaustic/)
 * (@catacaustic)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/adding-theme-support-for-post-formats-i-get-some-errors/#post-6444360)
 * The problem is all of the opening and closing PHP tags that you have. That’s 
   causing the `functions.php` file to output blank new-lines before anything is
   supposed to be output.
 * You only want to have one opening `<?php` tag, and no closing tag in the file.
   As a (very) truncated example…
 *     ```
       <?php
           add_theme_support( 'post-formats', array( 'standard', 'link' ) ); ?>
           remove_filter( 'the_content', 'wpautop' );
           remove_filter( 'the_excerpt', 'wpautop' );
   
           // Add the rest of the PHP lines here - WITHOUT any tags.
       ```
   
 *  Thread Starter [vtinath](https://wordpress.org/support/users/vtinath/)
 * (@vtinath)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/adding-theme-support-for-post-formats-i-get-some-errors/#post-6444363)
 * That seems to have worked! Thank you SO much!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding theme support for post formats – I get some errors’ is closed 
to new replies.

## Tags

 * [link](https://wordpress.org/support/topic-tag/link/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [vtinath](https://wordpress.org/support/users/vtinath/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/adding-theme-support-for-post-formats-i-get-some-errors/#post-6444363)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
