• I know there are a lot of posts about this topic but none really helped me so I give it another try. Any suggestions are highly appreciated.

    My goal is to hide the authorbox on the above webpage. So I am using the below in my style.css file in the child theme:

    .postauthor {
    display: none;
    }

    However, it looks like my child theme is not loaded/taken into consideration when loading the page the author box is still there at the bottom.

    I use the following in my functions.php:

    <?php

    function example_enqueue_styles() {

    // enqueue parent styles
    wp_enqueue_style(‘parent-theme’, get_template_directory_uri() .’/style.css’);

    }
    add_action(‘wp_enqueue_scripts’, ‘example_enqueue_styles’,1000);
    ?>

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Why don’t you just excise the author box code from the child theme and let the child theme deal with the site instead of trying to do all this via the functions file?

    Then, if you ever want the author box back, you’ll just add it back to the child or quit running the child theme.

    Thread Starter kevinziegler

    (@kevinziegler)

    @jnashhawkins – sorry perhaps I was not clear on the problem. I am actually trying to do that.

    I put:

    .postauthor {
    display: none;
    }

    in style.css in my child-theme. However, it looks like the Child Theme is not loaded after the parent theme and therefore the parent theme is taking precedent (for sure I can just add it to the parent theme but then I need to redo it after every update).

    • This reply was modified 5 years, 1 month ago by kevinziegler.

    When I looked at your site I see what appears to be the child theme ‘running things’ so any changes you’ve made to the child theme should take precedence over the parent unless you’ve somehow overridden that action with the codes you’ve placed in the functions file.

    That’s how child themes are supposed to work and that would include any CSS code you placed into your child theme’s CSS. You don’t need to enqueue anything as that is already done for you via the WordPress core.

    You can also add custom CSS code to the site via the customize section for your theme which should stay even after a parent theme update.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Load Child Theme last’ is closed to new replies.