• Resolved TinkJul

    (@tinkjul)


    Hello,

    I just changed themes to AccessPress Ray. I made the mistake of changing some things in the style editor. Now it’s showing I need to update the theme and I don’t want to lose my changes.

    1. I’m trying to add the child theme before I update. I’ve used the following and put it in the theme options customs css and saved it. There is also another css editor that is not within the theme options. Do I add this to both custom css areas?

    /*
    Theme Name: AccessPress Ray
    Theme URI: https://joyfulgiftsbyjulie.biz/accesspress-ray-child/
    Description: AccessPress Ray Theme
    Author: Julie Tucker
    Author URI: https://julietucker.com
    Template: AccessPress Ray
    Version: 1.0.0
    /*

    2. Also, I don’t have an author URI or don’t know where to find it. I’m not sure if this link is correct.

    3. I need to enqueue the parent theme stylesheet. Where do I add this? In the custom css where I added the child theme or the themes function php? If I add it to the function php, where within that do I add it.

    Here is the code provided by wp. Do I change the words theme to my theme or leave the code as is?

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

    }
    ?>

    Ps I have not activated it yet.

    Thank You!

Viewing 11 replies - 1 through 11 (of 11 total)
  • It looks like you’re on the right track.

    1) Usually the style header will go directly in the style.css file within your child theme. I’m not 100% sure of the effects of saving it in the editor like so.

    2) You don’t necessarily need the author URI, it’s there to provide a link to your other work. Theme Name is the only requirement in that header.

    3) You’ll want to enqueue the parent stylesheet in the functions.php file located in the child theme folder.

    As always, make sure you have backups.

    Thread Starter TinkJul

    (@tinkjul)

    I can’t get the child theme to show up in the themes to activate it.

    My theme has a plugin for custom css. This is what I put there and nothing is happening. Should the placement be somewhere else and is the html correct?
    Thanks.

    /*
    Theme Name: AccessPress Ray
    Theme URI: https://joyfulgiftsbyjulie.biz/accesspress-ray-child/
    Description: AccessPress Ray Theme
    Author: Julie Tucker
    Author URI: https://julietucker.com
    Template: AccessPress Ray
    Version: 1.0.0
    /*

    <?php
    function theme_enqueue_styles() {

    $parent_style = \’parent-style\’;

    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 )
    );
    }
    add_action( \’wp_enqueue_scripts\’, \’theme_enqueue_styles\’ );
    ?>

    Using the css plugin may be part of the issue. In your accesspress-ray theme, create a style.css file if you haven’t already.

    Then place your css header in style.css:

    /*
    Theme Name: AccessPress Ray
    Theme URI: https://joyfulgiftsbyjulie.biz/accesspress-ray-child/
    Description: AccessPress Ray Theme
    Author: Julie Tucker
    Author URI: https://julietucker.com
    Template: AccessPress Ray
    Version: 1.0.0
    */

    Your original enqueue code should work, but I’m guessing it can’t enqueue the parent theme’s styles because it can’t use the css header as reference. Hard to say without seeing your setup.

    Thread Starter TinkJul

    (@tinkjul)

    I just found a plugin for this. The Child Theme Wizard. It worked right away. Some things messed up, my sidebar widgets went into my footer and my colors. Nothing I can’t fix though. Woot! ??

    Thread Starter TinkJul

    (@tinkjul)

    Hi Justin,

    One more question. I have everything set up now with the child theme. Of course now I have an update to my parent theme. Can I make the update and not lose anything?

    Thanks!

    It sounds like you’re good to go. Like I said before, just make sure you have backups in place.

    Thread Starter TinkJul

    (@tinkjul)

    Thank You!

    Can you mark your question question as resolved? Thanks

    Thread Starter TinkJul

    (@tinkjul)

    t

    Thread Starter TinkJul

    (@tinkjul)

    I tried to do that yesterday, it won’t let me. It wants me to submit content or it pops up and says “not so fast”.

    All I can do now is post. There isn’t even a button to click that says resolved.

    Sorry

    Glad you got everything working. Looks like you issue is mark as resolved.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Where to place css when adding child theme’ is closed to new replies.