• Resolved xan3ver

    (@xan3ver)


    I have a child theme activated. I was trying a couple of different things, because it did not seem as though my child theme was working correctly. I have now changed something that has made a few of the styling that I have added, to not work.eg:

    My main menu is not centered anymore, this is what I have in my stylesheet:

    *Centre main menu
    */
    .main-navigation ul.nav-menu,
    .main-navigation div.nav-menu > ul {
    text-align: center;
    }

    My header image and a few of the images in my sidebar has a border again:

    /*Remove border around header image
    */
    .entry-content img, .comment-content img, .widget img, img.header-image, .author-avatar img, img.wp-post-image {
    border-radius: none !important;
    box-shadow: none !important;
    }

    The padding below the main nav bar has increased again:

    /*Remove padding under menu
    */

    .site-header {
    padding-bottom: 0;
    }

    Proudly powered by wordpress is visible again:

    /*Hide ‘proudly powered by wordpress
    */
    a[title=’Semantic Personal Publishing Platform’] { display: none; }

    And quite a couple of other things…. I think that I have set my child theme up wrong. Please help! This is how my the code at the top of my child style.css:

    /*
    Theme Name: twentytwelvechild
    Author: the WordPress team
    Author URI: https://wordpress.org/
    Template: twentytwelve
    Version: 1.7
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: light, gray, white, one-column, two-columns, right-sidebar, fluid-layout, responsive-layout, custom-background, custom-header, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready
    Text Domain: twentytwelve
    */

Viewing 15 replies - 16 through 30 (of 35 total)
  • Thread Starter xan3ver

    (@xan3ver)

    ugh, and now my whole site has fallen apart!

    it did change you have no styling now

    looks like there an error in you functions.php file

    do you have the source code in functions.php enclosed with <?php ?> tags ?

    Thread Starter xan3ver

    (@xan3ver)

    I do not know? Sorry, I am very new at coding… This is what is in my functions file:

    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
        wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    
    }
    
    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' );
    
    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/rtl.css' );
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/editor-style.css' );
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/editor-style-rtl.css' );
    }
    ?>

    You have multiple enqueue statements try deleting everything down to the <?php tag.

    Thread Starter xan3ver

    (@xan3ver)

    It took away the two lines in the dashboard, but it still appears on website. And still no styling!

    your functions.php file should look like this now

    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/rtl.css' );
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/editor-style.css' );
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/editor-style-rtl.css' );
    }
    ?>

    do you still have your cache plugin active ? If so clear it and disable it for now.

    Thread Starter xan3ver

    (@xan3ver)

    Yup, functions file looks like above.

    Ive cleared the cache and deactivated the plugin.

    The two lines above now does not appear on the website. Still no styling though.

    I’m looking for the problem. It has to be either in the style.css or functions.php file.

    Your styles are still not being enqueued so the problem is still with the functions.php file

    I created a child theme with the code above and it worked. Does your functions.php file look like the code above.

    Thread Starter xan3ver

    (@xan3ver)

    Yes, my functions.php looks exactly like the one you last posted above!

    Do you have a file named header.php in your child theme’s folder? If so, do you call wp_head() in that file? Also, check the header.php in your parent theme’s folder and see if wp_head() is being called there.

    Thread Starter xan3ver

    (@xan3ver)

    I do have a header in my child. but it does not call wp_head(). Parent theme does though, should I add this to my child header?

Viewing 15 replies - 16 through 30 (of 35 total)
  • The topic ‘Child Theme problems’ is closed to new replies.