Community Forums › Forums › Archived Forums › General Discussion › Cannot modify header information error message (magazine pro)
Tagged: Magazine Pro
- This topic has 7 replies, 2 voices, and was last updated 7 years, 7 months ago by Saqib Ali.
-
AuthorPosts
-
September 25, 2016 at 8:57 am #193674Saqib AliMember
I've migrated my local site online (http://britishhomeopathic.co.uk) but unfortunately when I go into the plugins section, I get this error message. Not too sure what I need to do...
Warning: Cannot modify header information - headers already sent by (output started at /home/bhauk/public_html/wp-content/themes/magazine-pro/functions.php:195) in /home/bhauk/public_html/wp-includes/pluggable.php on line 1174
http://britishhomeopathic.co.ukSeptember 25, 2016 at 9:04 am #193675Saqib AliMemberif ( !function_exists('check_ajax_referer') ) : /** * Verifies the Ajax request to prevent processing requests external of the blog. * * @since 2.0.3 * * @param int|string $action Action nonce. * @param false|string $query_arg Optional. Key to check for the nonce in <code>$_REQUEST</code> (since 2.5). If false, * <code>$_REQUEST</code> values will be evaluated for '_ajax_nonce', and '_wpnonce' * (in that order). Default false. * @param bool $die Optional. Whether to die early when the nonce cannot be verified. * Default true. * @return false|int False if the nonce is invalid, 1 if the nonce is valid and generated between * 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago. */
Line 1174 is
* @param int|string $action Action nonce.
September 25, 2016 at 9:07 am #193676Saqib AliMemberAnd within the functions. php file
/home/bhauk/public_html/wp-content/themes/magazine-pro/functions.php:195
line 195 doesn't exist, the last line of code is on line 193September 25, 2016 at 10:14 am #193678Saqib AliMemberTwo more error messages appearing, when I try logging into wp-admin.
// validate action so as to default to the login screen if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) ) $action = 'login'; nocache_headers(); header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset')); if ( defined( 'RELOCATE' ) && RELOCATE ) { // Move flag is set if ( isset( $_SERVER['PATH_INFO'] ) && ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) ) $_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], '', $_SERVER['PHP_SELF'] ); $url = dirname( set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] ) ); if ( $url != get_option( 'siteurl' ) ) update_option( 'siteurl', $url ); } //Set a cookie now to see if they are supported by the browser. $secure = ( 'https' === parse_url( wp_login_url(), PHP_URL_SCHEME ) ); setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure ); if ( SITECOOKIEPATH != COOKIEPATH ) setcookie( TEST_COOKIE, 'WP Cookie check', 0, SITECOOKIEPATH, COOKIE_DOMAIN, $secure );
Warning: Cannot modify header information - headers already sent by (output started at /home/bhauk/public_html/wp-content/themes/magazine-pro/functions.php:195) in /home/bhauk/public_html/wp-login.php on line 402
Line 402:
header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
Warning: Cannot modify header information - headers already sent by (output started at /home/bhauk/public_html/wp-content/themes/magazine-pro/functions.php:195) in /home/bhauk/public_html/wp-login.php on line 415
Line 415:
setcookie( TEST_COOKIE, 'WP Cookie check', 0, COOKIEPATH, COOKIE_DOMAIN, $secure );
September 25, 2016 at 12:02 pm #193685ChristophMemberHi,
Since the website insists there is a line 195 in your functions.php, check that you are looking at the right file.
There is also no need to paste code from WordPress core files.
September 25, 2016 at 4:07 pm #193695Saqib AliMemberDuly noted re regurgitating core files.
From the functions.php file in public_html/wp-content/themes/magazine-pro
<?php //* Start the engine include_once( get_template_directory() . '/lib/init.php' ); //* Setup Theme include_once( get_stylesheet_directory() . '/lib/theme-defaults.php' ); //* Set Localization (do not remove) load_child_theme_textdomain( 'magazine', apply_filters( 'child_theme_textdomain', get_stylesheet_directory() . '/languages', 'magazine' ) ); //* Child theme (do not remove) define( 'CHILD_THEME_NAME', __( 'Magazine Pro Theme', 'magazine' ) ); define( 'CHILD_THEME_URL', 'http://my.studiopress.com/themes/magazine/' ); define( 'CHILD_THEME_VERSION', '3.1' ); //* Enqueue Google Fonts and JS script add_action( 'wp_enqueue_scripts', 'magazine_enqueue_scripts' ); function magazine_enqueue_scripts() { wp_enqueue_script( 'magazine-entry-date', get_bloginfo( 'stylesheet_directory' ) . '/js/entry-date.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_script( 'magazine-responsive-menu', get_bloginfo( 'stylesheet_directory' ) . '/js/responsive-menu.js', array( 'jquery' ), '1.0.0' ); wp_enqueue_style( 'dashicons' ); wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Roboto:300,400|Raleway:400,500,900', array(), CHILD_THEME_VERSION ); } //* Add HTML5 markup structure add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); //* Add viewport meta tag for mobile browsers add_theme_support( 'genesis-responsive-viewport' ); //* Add new image sizes add_image_size( 'home-middle', 360, 200, true ); add_image_size( 'home-top', 750, 420, true ); add_image_size( 'sidebar-thumbnail', 100, 100, true ); //* Add support for additional color styles add_theme_support( 'genesis-style-selector', array( 'magazine-pro-blue' => __( 'Magazine Pro Blue', 'magazine' ), 'magazine-pro-green' => __( 'Magazine Pro Green', 'magazine' ), 'magazine-pro-orange' => __( 'Magazine Pro Orange', 'magazine' ), ) ); //* Add support for custom header add_theme_support( 'custom-header', array( 'default-text-color' => '000000', 'header-selector' => '.site-title a', 'header-text' => false, 'height' => 90, 'width' => 380, ) ); //* Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_before_header', 'genesis_do_nav' ); //* Add primary-nav class if primary navigation is used add_filter( 'body_class', 'backcountry_no_nav_class' ); function backcountry_no_nav_class( $classes ) { $menu_locations = get_theme_mod( 'nav_menu_locations' ); if ( ! empty( $menu_locations['primary'] ) ) { $classes[] = 'primary-nav'; } return $classes; } //* Customize search form input box text add_filter( 'genesis_search_text', 'magazine_search_text' ); function magazine_search_text( $text ) { return esc_attr( __( 'Search the site ...', 'magazine' ) ); } //* Modify the size of the Gravatar in the author box add_filter( 'genesis_author_box_gravatar_size', 'magazine_author_box_gravatar' ); function magazine_author_box_gravatar( $size ) { return 140; } //* Modify the size of the Gravatar in the entry comments add_filter( 'genesis_comment_list_args', 'magazine_comments_gravatar' ); function magazine_comments_gravatar( $args ) { $args['avatar_size'] = 100; return $args; } //* Remove entry meta in entry footer add_action( 'genesis_before_entry', 'magazine_remove_entry_meta' ); function magazine_remove_entry_meta() { //* Remove if not single post if ( ! is_single() ) { remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 ); } } //* Remove comment form allowed tags add_filter( 'comment_form_defaults', 'magazine_remove_comment_form_allowed_tags' ); function magazine_remove_comment_form_allowed_tags( $defaults ) { $defaults['comment_notes_after'] = ''; return $defaults; } //* Add support for 3-column footer widgets add_theme_support( 'genesis-footer-widgets', 3 ); //* Add support for after entry widget add_theme_support( 'genesis-after-entry-widget-area' ); //* Relocate after entry widget remove_action( 'genesis_after_entry', 'genesis_after_entry_widget_area' ); add_action( 'genesis_entry_footer', 'genesis_after_entry_widget_area' ); //* Register widget areas genesis_register_sidebar( array( 'id' => 'home-top', 'name' => __( 'Home - Top', 'magazine' ), 'description' => __( 'This is the top section of the homepage.', 'magazine' ), ) ); genesis_register_sidebar( array( 'id' => 'home-middle', 'name' => __( 'Home - Middle', 'magazine' ), 'description' => __( 'This is the middle section of the homepage.', 'magazine' ), ) ); genesis_register_sidebar( array( 'id' => 'home-bottom', 'name' => __( 'Home - Bottom', 'magazine' ), 'description' => __( 'This is the bottom section of the homepage.', 'magazine' ), ) ); //* Research Reports Template //add_post_type_support('stg_slides', array( 'thumbnail' ) ); register_post_type( 'research_report', array( 'labels' => array( 'name' => __( 'Reports' ), 'singular_name' => __( 'Report' ) ), 'public' => true, 'has_archive' => true, ) ); //* Dashicons add_action( 'wp_enqueue_scripts', 'jk_load_dashicons' ); function jk_load_dashicons() { wp_enqueue_style( 'dashicons' ); } //* Media Uploader allows SVG files function cc_mime_types($mimes) { $mimes['svg'] = 'image/svg+xml'; return $mimes; } add_filter('upload_mimes', 'cc_mime_types'); //* Add support for custom header add_theme_support( 'custom-header', array( 'header-selector' => '.site-title a', 'header-text' => false, 'height' => 380, 'width' => 90, ) ); //* Footer info add_action( 'genesis_footer', 'sp_custom_footer' ); function sp_custom_footer() { ?> <a href="http://www.britishhomeopathic.org/copyright"><strong>COPYRIGHT</strong></a> <strong>·</strong> <a href="http://www.britishhomeopathic.org/disclaimer"><strong>DISCLAIMER </strong></a> <strong>·</strong> <a href="http://www.britishhomeopathic.org/privacy-policy"><strong>PRIVACY POLICY </strong></a> <strong>·</strong> <a href="http://www.britishhomeopathic.org/terms-of-use"><strong>TERMS OF USE </strong></a> <strong>·</strong> <a href="http://www.britishhomeopathic.org/sitemap"><strong>SITEMAP</strong></a> <br><br /> <p>© <?php echo date('Y') ?> · <a href="http://www.britishhomeopathic.org/">British Homeopathic Association</a> · All Rights Reserved</p> <p>Registered Charity No: <strong>235900</strong> · Company Number Guarantee: <strong>102915</strong></p> <?php } ?>
September 25, 2016 at 5:44 pm #193701ChristophMemberRemove the closing php tag
?>
September 27, 2016 at 5:13 am #193752Saqib AliMemberF****** hell! All that bloody headache because of a closing php tag!?!?>
I owe you a coffee!
Cheers
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.