Warning: Cannot modify header information
-
Buenos días, estoy dise?ando mi tienda online y me esta dando el siguiente error cuando a?ado un producto al carrito:
Warning: Cannot modify header information – headers already sent by (output started at /home/customer/www/perlighting.com/public_html/wp-content/themes/generatepress/header.php:12) in /home/customer/www/perlighting.com/public_html/wp-content/themes/generatepress/header.php on line 81
Os paso el functios.php para ver si me podéis dar una solución.
<?php /** * GeneratePress. * * Please do not make any edits to this file. All edits should be done in a child theme. * * @package GeneratePress */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } // Set our theme version. define( 'GENERATE_VERSION', '2.4.2' ); if ( ! function_exists( 'generate_setup' ) ) { add_action( 'after_setup_theme', 'generate_setup' ); /** * Sets up theme defaults and registers support for various WordPress features. * * @since 0.1 */ function generate_setup() { // Make theme available for translation. load_theme_textdomain( 'generatepress' ); // Add theme support for various features. add_theme_support( 'automatic-feed-links' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'status' ) ); add_theme_support( 'woocommerce' ); add_theme_support( 'title-tag' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( 'align-wide' ); add_theme_support( 'responsive-embeds' ); add_theme_support( 'custom-logo', array( 'height' => 70, 'width' => 350, 'flex-height' => true, 'flex-width' => true, ) ); // Register primary menu. register_nav_menus( array( 'primary' => __( 'Primary Menu', 'generatepress' ), ) ); /** * Set the content width to something large * We set a more accurate width in generate_smart_content_width() */ global $content_width; if ( ! isset( $content_width ) ) { $content_width = 1200; /* pixels */ } // This theme styles the visual editor to resemble the theme style. add_editor_style( 'css/admin/editor-style.css' ); } } /** * Get all necessary theme files */ $theme_dir = get_template_directory(); require $theme_dir . '/inc/theme-functions.php'; require $theme_dir . '/inc/defaults.php'; require $theme_dir . '/inc/class-css.php'; require $theme_dir . '/inc/css-output.php'; require $theme_dir . '/inc/general.php'; require $theme_dir . '/inc/customizer.php'; require $theme_dir . '/inc/markup.php'; require $theme_dir . '/inc/typography.php'; require $theme_dir . '/inc/plugin-compat.php'; require $theme_dir . '/inc/block-editor.php'; require $theme_dir . '/inc/migrate.php'; require $theme_dir . '/inc/deprecated.php'; if ( is_admin() ) { require $theme_dir . '/inc/meta-box.php'; require $theme_dir . '/inc/dashboard.php'; } /** * Load our theme structure */ require $theme_dir . '/inc/structure/archives.php'; require $theme_dir . '/inc/structure/comments.php'; require $theme_dir . '/inc/structure/featured-images.php'; require $theme_dir . '/inc/structure/footer.php'; require $theme_dir . '/inc/structure/header.php'; require $theme_dir . '/inc/structure/navigation.php'; require $theme_dir . '/inc/structure/post-meta.php'; require $theme_dir . '/inc/structure/sidebars.php'; /** * Use WC 2.0 variable price format, now include sale price strikeout * * @param string $price * @param object $product * @return string */ function wc_wc20_variation_price_format( $price, $product ) { // Main Price $prices = array( $product->get_variation_price( 'min', true ), $product->get_variation_price( 'max', true ) ); $price = $prices[0] !== $prices[1] ? sprintf( __( 'Desde: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); // Sale Price $prices = array( $product->get_variation_regular_price( 'min', true ), $product->get_variation_regular_price( 'max', true ) ); sort( $prices ); $saleprice = $prices[0] !== $prices[1] ? sprintf( __( '', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] ); if ( $price !== $saleprice ) { $price = '<del>' . $saleprice . '</del> <ins>' . $price . '</ins>'; } return $price; } add_filter( 'woocommerce_variable_sale_price_html', 'wc_wc20_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wc_wc20_variation_price_format', 10, 2 ); add_filter('woof_use_chosen', function($is) { if (wp_is_mobile()) { return false; } return $is; }); add_filter ('wc_add_to_cart_message_html', '__return_null');
Creo que falta el
?>
y por eso me está dando fallo, es posible?The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Warning: Cannot modify header information’ is closed to new replies.