Headers already sent error
-
Very strange behaviour which I hope you can help with
When using a shortcode I have written, a saving a page errors with
Warning: Cannot modify header information – headers already sent by (output started at /www2/a36/dev.mysite.com/web/wp-content/themes/italybiketours/shortcodes-tiles.php:26) in /www2/a36/dev.italybiketours.co.uk/web/wp-admin/post.php on line 197
Warning: Cannot modify header information – headers already sent by (output started at /www2/a36/dev.mysite.com/web/wp-content/themes/italybiketours/shortcodes-tiles.php:26) in /www2/a36/dev.italybiketours.co.uk/web/wp-includes/pluggable.php on line 1210
I’ve tested with minimum – child of twenty seventeen theme and shortcode only function, only plugin yoast seo.
Doesn’t error with yoast deactivated
Sole page content
[itb-tile page = ‘/gran-fondo-packages/’ pic=’/wp-content/uploads/2016/08/granfondotour3-560×460.jpg’ title=’Gran Fondo Packages’]
[itb-tile page = ‘/gran-fondo-packages/’ pic=’/wp-content/uploads/2016/08/granfondotour3-560×460.jpg’ title=’Gran Fondo Packages’]
[itb-tile page = ‘/gran-fondo-packages/’ pic=’/wp-content/uploads/2016/08/granfondotour3-560×460.jpg’ title=’Gran Fondo Packages’]shortcode set up in function file
add_shortcode('itb-tile', 'itb_tile'); function itb_tile ($attr) { if (!empty( $attr['pic'])) $pic_url=$attr['pic'] ; if (!empty( $attr['page'])) $page=$attr['page'] ; if (!empty( $attr['title'])) $title=$attr['title'] ; ?> <div class="element portfolio3filter_wrapper"> <div class="one_third gallery3 filterable gallery_type animated1"> <a href=" <?php echo $page ?> "> <img src=" <?php echo $pic_url ?> " alt=" <?php echo $title ?> " /></a> <div class="thumb_content fullwidth"> <div class="thumb_title"> <a href=" <?php echo $page ?> "><h3><?php echo $title ?></h3></a> </div> <div class="thumb_meta"> </div> </div> </div> </div> <?php }
The error doesn’t happen if yoast is deactivated, and the page saves correctly whether yoast is activated or not.
- The topic ‘Headers already sent error’ is closed to new replies.