• Resolved Athletica

    (@athletica)


    Hi!

    I have just installed the latest version of Spacious theme and created a child theme with one style.css file and a functions.php file.

    Everything works good except when I will add images to posts.
    It is possible to upload images to the media library, but I can′t add images to the posts since they don′t even show up, only a loading icon.

    It works like a charm when I switch to the original theme.
    I have checked that no other errors exist via the debug mode.

    Anyone has any clue what the problem can be?

    All help appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Athletica

    (@athletica)

    I found the problem for not be able to add images on pages/posts and have solved it!

    See how to create child themes in the correct way: https://codex.www.ads-software.com/Child_Themes

    The problem was how the style.css file was written in the child theme. It doesn′t work to import style in style.css if a functions.php file exists.

    The way I solved it (still for the child theme):

    In style.css:

    /*
    Theme Name: 	Spacious Child Theme
    Theme URI: 		https://themegrill.com/themes/spacious
    Description:	Spacious Child Theme
    Author: 		ThemeGrill
    Author URI: 	https://themegrill.com
    Template:       spacious
    Version: 		1.0
    */

    In functions.php:

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    ?>

    it works perfectly. tnx a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Child theme: cannot add images to posts’ is closed to new replies.