update to 1.1.9 -> child theme not completely applied
-
Hi, I use screens as parent theme on some of my sites.
I updated to the 1.1.9 version and a lot (maybe all) of the child theme style are not recognised, so I had to switch back to oldest version.Are there some changes on implementing child themes?
-
error I have from updating preferences from “new” parent theme to child one:
Warning: Cannot modify header information – headers already sent by (output started at /web/htdocs/www.organicillusion.com/home/wp-includes/formatting.php:5104) in /web/htdocs/www.organicillusion.com/home/wp-includes/pluggable.php on line 1223
Hello @resunoiz,
Could you let me know what is your site? and what did you add in main child theme functions.php?
https://www.organicillusion.com/
https://www.gianlucadavid.com/
https://www.lorenaluccioni.it/they all have different functions.php
I tried to de-activate ALL plugins, remove all customizations to functions.php but nothing works (the message infact says is a a problem not related to my functions file).- This reply was modified 5 years, 11 months ago by resunoiz.
Could you show me what you added in child theme functions.php file?
AS SAID, I TRIED TO UPLOAD A “VIRGIN” CHILD THEME.
Whithout any personalization, and all plugins shut down.Same error.
Anyway…Here’s what is now in functions.php of https://www.organicillusion.com<?php add_action( 'wp_enqueue_scripts', 'enqueue_parent_theme_style' ); function enqueue_parent_theme_style() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); } add_filter( 'gettext', 'cyb_filter_gettext', 10, 3 ); function cyb_filter_gettext( $translated, $original, $domain ) { // Use the text string exactly as it is in the translation file if ( $translated == "Categoria: %s" ) { $translated = "%s"; } return $translated; } /** * Setup page header cover * * @return bool */ function screenr_page_header_cover_2() { if ( is_page_template( 'template-frontpage.php' ) ) { return false; } $image = $title = $desc = ''; if ( is_singular() && ! is_attachment() ) { $title = get_the_title(); } elseif ( is_search() ) { $title = get_the_title(); } elseif ( ( is_front_page() ) && ! is_attachment() ) { $title = get_the_title(); } elseif ( is_404() ) { $title = sprintf( esc_html__( '%s', 'screenr' ), '<i class="fa fa-frown-o"></i><br>' ); } elseif ( is_home() ) { $title = get_the_title(); } else { $title = get_the_archive_title(); $desc = get_the_archive_description(); } if ( ! $image ) { $image = get_header_image(); } $is_parallax = true; $item = array( 'position' => 'center', 'pd_top' => get_theme_mod( 'page_header_pdtop') == '' ? 13 : get_theme_mod( 'page_header_pdtop'), 'pd_bottom' => get_theme_mod( 'page_header_pdbottom' ) == '' ? 13 : get_theme_mod( 'page_header_pdbottom' ) , 'title' => $title, 'desc' => $desc, 'image' => $image, ); $classes = array( 'section-slider', 'swiper-slider', ); if ( $is_parallax ) { $classes[] = 'fixed'; } $item = apply_filters( 'screenr_page_header_item', $item ); if ( $item['image'] ) { $classes[] = 'has-image'; } else { $classes[] = 'no-image'; } $classes = apply_filters( 'screenr_page_header_cover_class', $classes ); ?> <section id="page-header-cover" class="<?php echo esc_attr( join( ' ', $classes ) ); ?>" > <div class="swiper-container" data-autoplay="0"> <div class="swiper-wrapper"> <?php $style = ""; if ( $item['image'] ) { $style = ' style="background-image: url(\''.esc_url( $item['image'] ).'\');" '; } $html = '<div class="swiper-slide slide-align-'.esc_attr( $item['position'] ).'"'.$style.'>'; $style = ''; if ( $item['pd_top'] != '' ) { $style .='padding-top: '.floatval( $item['pd_top'] ).'%; '; } if ( $item['pd_bottom'] != '' ) { $style .='padding-bottom: '.floatval( $item['pd_bottom'] ).'%; '; } if ( $style != '' ) { $style = ' style="'.$style.'" '; } $html .= '<div class="swiper-slide-intro">'; $html .= '<div class="swiper-intro-inner"'.$style.'>'; if ( $item['title'] ) { $html .= '<h2 class="swiper-slide-heading">'.wp_kses_post( $item['title'] ).'</h2>'; } if ( $item['desc'] ) { $html .= '<div class="swiper-slide-desc">'.apply_filters( 'screenr_content_text', $item['desc'] ).'</div>'; } $html .= '</div>'; $html .= '</div>'; $html .= '<div class="overlay"></div>'; $html .= '</div>'; echo $html; ?> </div> </div> </section> <?php } add_action( 'screenr_after_site_header_mod', 'screenr_page_header_cover_2' ); /** * Generate Gallery HTML * * @since 1.2.6 * @param bool|true $echo * @return string */ function screenr_gallery_mod_generate( $echo = true ){ $div = ''; $data = screenr_get_section_gallery_data(); $display_type = get_theme_mod( 'gallery_display', 'grid' ); $lightbox = get_theme_mod( 'gallery_lightbox', 1 ); $class = ''; if ( $lightbox ) { $class = ' enable-lightbox '; } $col = absint( get_theme_mod( 'gallery_col', 4 ) ); if ( $col <= 0 ) { $col = 4; } switch( $display_type ) { case 'masonry': $html = screenr_gallery_mod_html( $data ); if ( $html ) { $div .= '<div data-col="'.$col.'" class="g-zoom-in gallery-masonry '.$class.' gallery-grid g-col-'.$col.'">'; $div .= $html; $div .= '</div>'; } break; case 'carousel': $html = screenr_gallery_mod_html( $data ); if ( $html ) { $div .= '<div data-col="'.$col.'" class="g-zoom-in gallery-carousel'.$class.'">'; $div .= $html; $div .= '</div>'; } break; case 'slider': $html = screenr_gallery_mod_html( $data , true , 'full' ); if ( $html ) { $div .= '<div class="gallery-slider'.$class.'">'; $div .= $html; $div .= '</div>'; } break; case 'justified': $html = screenr_gallery_mod_html( $data, false ); if ( $html ) { $gallery_spacing = absint( get_theme_mod( 'gallery_spacing', 20 ) ); $div .= '<div data-spacing="'.$gallery_spacing.'" class="g-zoom-in gallery-justified'.$class.'">'; $div .= $html; $div .= '</div>'; } break; default: // grid $html = screenr_gallery_mod_html( $data ); if ( $html ) { $div .= '<div class="gallery-grid g-zoom-in '.$class.' g-col-'.$col .'">'; $div .= $html; $div .= '</div>'; } break; } if ( $echo ) { echo $div; } else { return $div; } } /** * Generate HTML content for gallery items. * * @since 1.2.6 * * @param $data * @param bool|true $inner * @return string */ function screenr_gallery_mod_html( $data, $inner = true, $size = 'full' ) { $max_item = get_theme_mod( 'gallery_number', 10 ); $html = ''; if ( ! is_array( $data ) ) { return $html; } $n = count( $data ); if ( $max_item > $n ) { $max_item = $n; } $i = 0; while( $i < $max_item ){ $photo = current( $data ); $i ++ ; if ( $size == 'full' ) { $thumb = $photo['full']; } else { $thumb = $photo['thumbnail']; } $html .= '<a href="/category/merchandise/" class="g-item" title="'.esc_attr( sanitize_text_field( $photo['title'] ) ).'">'; if ( $inner ) { $html .= '<span class="inner">'; $html .= '<span class="inner-content">'; $html .= '<div><?php echo esc_html( $title ); ?></div>'; $html .= '<img src="'.esc_url( $thumb ).'" alt="">'; $html .= '</span>'; $html .= '</span>'; } else { $html .= '<img src="'.esc_url( $thumb ).'" alt="">'; } $html .= '</a>'; next( $data ); } reset( $data ); return $html; } /** * Remove the native playlist template and load our custom template * @link https://wordpress.stackexchange.com/q/141767/26350 */ add_action( 'wp_playlist_scripts', 'wpse_141767_wp_playlist_scripts' ); function wpse_141767_wp_playlist_scripts() { remove_action( 'wp_footer', 'wp_underscore_playlist_templates', 0 ); add_action( 'wp_footer', 'wpse_141767_wp_underscore_playlist_templates', 0 ); } /** * Our custom playlist template. */ function wpse_141767_wp_underscore_playlist_templates() { ?> <script type="text/html" id="tmpl-wp-playlist-current-item"> <# if ( data.image ) { #> <img src="{{ data.thumb.src }}"/> <# } #> <div class="wp-playlist-caption"> <span class="wp-playlist-item-meta wp-playlist-item-title">“{{ data.title }}”</span> <# if ( data.meta.album ) { #><span class="wp-playlist-item-meta wp-playlist-item-album">{{ data.meta.album }}</span><# } #> <# if ( data.meta.artist ) { #><span class="wp-playlist-item-meta wp-playlist-item-artist">{{ data.meta.artist }}</span><# } #> </div> </script> <script type="text/html" id="tmpl-wp-playlist-item"> <div class="wp-playlist-item"> <a class="wp-playlist-caption" href="{{ data.src }}"> {{ data.index ? ( data.index + '. ' ) : '' }} <# if ( data.caption ) { #> {{ data.caption }} <# } else { #> <span class="wp-playlist-item-title">“{{{ data.title }}}”</span> <# if ( data.artists && data.meta.artist ) { #> <span class="wp-playlist-item-artist"> — {{ data.meta.artist }}</span> <# } #> <# } #> </a> <# if ( data.meta.length_formatted ) { #> <div class="wp-playlist-item-length">{{ data.meta.length_formatted }}</div> <# } #> </div> <!-- BEGIN CHANGES --> <a href="{{ data.src }}" class="wpse-download" download="">download</a> <!-- END CHANGES --> </script> <?php }
Hi @resunoiz,
Please submit your question here and our tech support will help you:
- The topic ‘update to 1.1.9 -> child theme not completely applied’ is closed to new replies.