Hey guys, So I'm in need of some help. I'm making a new custom Skin/Module for Wordpress (Minecraft servers specifically). So this is the error i get "Warning: Cannot modify header information - headers already sent by (output started at /home/wwwrhino/public_html/bradsblog/wp-content/plugins/MC-Server-IP/Server-Ip.php:56) in /home/wwwrhino/public_html/bradsblog/wp-includes/pluggable.php on line 866" I'm raging because this is the plugin so far: That error comes up when I try and add media... However it still adds the media...
file Server-Ip.php on line No 56 has echo something and to avoid this error either you use @ sign before header like @header(""); or use out put buffer functions.
Nothing issue in code please use your own or copy this.. <?php /* Plugin Name: Minecraft Server IP Plugin URI: http://bradsblog.co.uk Description: Want to simply show if your server is up? Look no further Author: Bradly Spicer Version: 0.1 Author URI: http://bradsblog.co.uk */ class MinecraftIPWidget extends WP_Widget { function MinecraftIPWidget() { $widget_ops = array('classname' => 'MinecraftIPWidget', 'description' => 'Displays your Minecraft IP' ); $this->WP_Widget('MinecraftIPWidget', 'Show your Minecraft IP', $widget_ops); } function form($instance) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); $title = $instance['title']; ?> <p><label for="<?php echo $this->get_field_id('title'); ?>">Title: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p> <p> <label for="<?php echo $this->get_field_id('title'); ?>">IP: <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo attribute_escape($title); ?>" /></label></p> </p> <?php } function update($new_instance, $old_instance) { $instance = $old_instance; $instance['title'] = $new_instance['title']; return $instance; } function widget($args, $instance) { extract($args, EXTR_SKIP); echo $before_widget; $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); if (!empty($title)) echo $before_title . $title . $after_title;; // WIDGET CODE GOES HERE echo "<h1>This is my new widget!</h1>"; echo $after_widget; } } add_action( 'widgets_init', create_function('', 'return register_widget("MinecraftIPWidget");') );?>
Tried this, it didn't work I didn't think PHP files used echo etc, I swear that was bat files, I will have a go though thanks. Does anyone else have advice?