• Hey,

    I’m using the Twenty Twelve WordPress theme and I wish to make changes so I can use custom css I have been putting it into the default style.css file and having to re-add the code every time I update but someone informed me I’d be better off using a Child Theme for this so I took a look at the docs for this and it looked pretty easy with just a style.css file so I added my style.css and screenshot.png file.

    It all seems to work but when I active the child theme and go to my WordPress blog the page is tiny and it’s not as wide… why?

    If I re-active the normal theme and add my custom CSS to that file it’s fine – even though it’s the same code but in a child theme?

    I don’t really wanna post my site URL here if I can help it.

    File: /wp-content/themes/twentytwelve-child/style.css
    Source/Code: https://uploadir.com/u/xzozx143 * JPG screenshot *

    So it’s the same code, just in a different file..

    Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Pretty hard to help you debug the issue without the URL.

    Have you tried it without importng bootstrap css?

    Thread Starter flexfm

    (@flexfm)

    Hi,

    Bootstrap CSS – is just buttons (.btn) it’s not the full Bootstrap. However, It seems it’s being caused by the glyphicons.css.. but if I put the glyphicons into the main CSS (not a child theme) it works fine without any problems and If I copy the full style.css from the Twenty Twelve folder (not the child) and paste it into the child’s style.css file but with the custom css added it works fine..

    I’m happy to provide the URL via email or PM (if that’s a feature here)?

    Thanks.

    Try enqueuing the files instead of @import and see if that make a difference

    add_action('wp_enqueue_scripts', 'enqueue_my_scripts');
    function enqueue_my_styles() {
    wp_enqueue_style( 'gliphicons', '//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-gliphicons.css' );
    wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css');
    wp_enqueue_style( 'child-theme', get_template_directory_uri() . '/style.css');
    }
    add_action('wp_enqueue_scripts', 'enqueue_my_styles');
    Thread Starter flexfm

    (@flexfm)

    Doing that causes this to show at the top:

    Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'enqueue_my_scripts' not found or invalid function name in /wp-includes/plugin.php on line 470

    did you put that in you child theme functions.php file?

    Thread Starter flexfm

    (@flexfm)

    Hi yes, that’s correct.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Maybe you don’t need this line:

    add_action('wp_enqueue_scripts', 'enqueue_my_scripts');

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Theme: Twenty Twelve] Child Theme?’ is closed to new replies.