Site logo

[Resolved] Child-Theme not working

Home Forums Support [Resolved] Child-Theme not working

Home Forums Support Child-Theme not working

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #698034
    Julia

    Hi

    I wanted to create my own template in child-theme. But when I add a page-custom.php at my generatepress-child folder, it doesn’t work. Only when I add the file to the generatepress folder.
    The same problem I have with custom post types. When I add them to functions.php in generatepress folder, it works. In child not.
    As I don’t see the printscreen either, I think there is a linking problem somewhere. Surprisingly the CSS works.

    Can you help me please?

    Thanks in advance

    Julia

    #698353
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    That’s strange – if the CSS in your child theme is working, the functions should be as well.

    Does your functions.php file have anything else in it?

    What about page-custom.php? Does it have the necessary template name at the top?: https://developer.wordpress.org/themes/template-files-section/page-template-files/#creating-custom-page-templates-for-global-use

    #701117
    Julia

    The content of functions.php is:

    <?php
    
    function child_theme_styles() {
      wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
      wp_enqueue_style( 'child-theme-css', get_stylesheet_directory_uri() .'/css/style.css' , array('parent-style'));
    
    }
    add_action( 'wp_enqueue_scripts', 'child_theme_styles' );

    The template name is referenced as follows:

    /**
     * The template for displaying all pages.
     *
     * This is the template that displays all pages by default.
     * Please note that this is the WordPress construct of pages
     * and that other 'pages' on your WordPress site will use a
     * different template.
     *
     * Template name: Kooperationen
     *
     * @package GeneratePress
     */
    #701130
    Julia

    solved, don’t ask me, what the problem was 😉 I replaced my child theme with your empty child theme and now it works…
    thanks

    #701472
    Tom
    Lead Developer
    Lead Developer

    Awesome 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.