0
votes

So I'm trying to create a child theme called premierpas from the wordpress theme "fullscreen-agency". I create the premierpas folder in the themes, then I added a css file with that content :

/*
 Theme Name:   Premier Pas
 Author:       Garga Le Noir
 Template:     fullscreen-agency
 Version:      1.0.0
*/

and a functions.php with this content :

<?php
function premierpas_enqueue_styles() {

    $parent_style = 'fullscreen-agency';

    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array( $parent_style ),null);
}

I've tried quite a few other versions of the functions code, without success. When I try to activate it, my website just breaks. I only have a message telling me there is a technical problem, and I get an email to activate the recovery mode. I'm sure the error is trivial and I'm sorry if I'm wasting your time, but I'm quite stuck on this... Any help will be appreciated, thanks in advance

1
Please use wordpress.stackexchange.com for this question that is related to Wordpress. It's hard to tell if this is really a programming issue as well.bestprogrammerintheworld
is the .css file named style.css?Cornel Raiu
make sure you read this: developer.wordpress.org/themes/advanced-topics/child-themes It seems you don't have the add_action( 'wp_enqueue_scripts', 'premierpas_enqueue_styles' );Cornel Raiu

1 Answers

0
votes

I created a child theme with the code you stated above and it worked for me. The one change I made was I set the parent to be twentyfifteen since I didn't have your fullscreen-agency parent theme. I assumed your file paths were...

wp-content/themes/premierpas/style.css
wp-content/themes/premierpas/functions.php

A couple things to try...

  1. Remove your functions.php file. If that solves the issue then perhaps you already have premierpas_enqueue_styles() defined in your parent theme or there is some related error.
  2. Enable the debug.log by adding the following to your wp-config.php file... define( 'WP_DEBUG', true ); then try reactivating the child theme and look at your wp-content/debug.log file to see if there are any relevant errors thrown that can help you troubleshoot further.