• Resolved TT

    (@wallacexpedition)


    I installed the theme Oyster and I want to make some changes that won’t be overwritten by updates. My page is https://www.w-ard.com

    I’ve read a child theme is the best way, so I created one and activated it.

    I have two questions now that it is more or less working.

    1) When I want to make a change to a particular file, what is the best practice method? The parent “style.css” file only has about the same info as my child style sheet, and there is no code in there (just a header). The parent theme has subfolders named “core” “css” “ext” “img” “js” and has about 40 .php files in the root folder.

    Do I re-create the file structure in my child folder and then copy any file I want to make changes to into those folders?
    Once I find the particular spot in the .php or .css file, should change that attribute, but then delete the rest of the code in the file so that it doesn’t override any other code? I don’t want to override code that might get updated later by the parent theme and leave mine outdated by the child.

    2) It seems important to create the child functions.php because the www.remarpro.com site said I need it to enqueue the parent and child theme stylesheets. Especially since there are more than one .css files in the parent theme.

    The problem is that I get the white screen of death when I have this file uploaded, so I deleted it for now. Here is the entire text of the child functions.php file:

    <?php
    
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri(https://w-ard.com/wp-content/themes/gt3-wp-oyster/) . '/style.css' );
    
    }
Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter TT

    (@wallacexpedition)

    Very helpful, and the section about Template Files and the link there to the Template Hierarchy were good reads.

    I realize now my problem is that my website wasn’t looking for my .php in the subfolder.

    A subsection of the wordpress help page you linked to is called “Referencing / Including Files in Your Child Theme” talks about the “get_stylesheet_directory()”.

    I believe this should go into my functions.php file, but for some reason I continue to get the white screen of death every time I put something into my functions.php file. I’m not sure I input the code right

    <?php
    
    require_once( get_stylesheet_directory() . '/core/registrator/css-js.php' );
    
    ?>

    I also changed a sprite (.png file), but it pulls up the old one.

    Starting to feel a little overwhelmed, maybe this is too technical for me and I should just write down the changes I make to the parent theme.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Which theme is this regarding? The functions.php file in the Child Theme can manipulate the parent theme files via “hooks” if the theme is set up right.

    Thread Starter TT

    (@wallacexpedition)

    It’s a theme called Oyster that I found on themeforest, maybe I shouldn’t ask for help here on it. It’s okay if I ask general questions though right? They won’t really support me for WordPress questions, just very basic troubleshooting with their theme.

    I’ll do a little research and see what I can find out about hooks

    David_G

    (@questas_admin)

    seems like updating my functions file gives me a white screen of death again for some annoying reason

    <?php
    
    .body {   /*This goes in style, not functions */
    text: black;
    }
    ?>

    #wallacepedition, With the above code you were mixing php and css together. The .body {} is css and goes into your Style.css file NOT the functions file.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    You can ask general questions here, the commercial rule on the www.remarpro.com forums is more about “I don’t know the answer because it’s commercial” rather than “I’m not allowed to discuss because it’s commercial”.

Viewing 5 replies - 16 through 20 (of 20 total)
  • The topic ‘setting up a child theme’ is closed to new replies.