Child theme breaks media library
-
I have made a child theme of Twenty Fourteen to show titles of category archives only.
It worked fine on my dev (Windows 7) server but not on the live (Linux) one. On the live server, the frontend was fine, but as soon as I tried to edit a post to add an image, I realised that the Media Library was broken – it looked empty and the little spinner just kept on whirling around. Galleries in posts also show a loading animation that never finishes.
On changing back to the parent them, I got the “Warning: Cannot modify header information – headers already sent by (output started at … /wp-content/themes/twentyfourteen-child/functions.php:1)”.
Both hinted at a problem with the child functions file, which just enqueues styles as recommended elsewhere. I have carefully checked for white space and can’t find any, and the file is saved as UTF-8 without BOM. I did the same in the 3 category archive files of the theme as well.
<?php add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) ); }
Now I am stumped.
- The topic ‘Child theme breaks media library’ is closed to new replies.