• Resolved benshepp

    (@benshepp)


    There is a function (in functions.php of course) called: ac_css_files()

    The wp_enqueue_style() calls inside that function are using get_template_directory_uri() to return a path to the CSS directories. If you try to create a child theme this is going to break your local CSS from being loaded!

    Change three lines (around line 100 in Functions.php) or override the entire function it in your local child’s functions.php (easy to do since the parent function is conveniently wrapped inside of:

    if ( ! function_exists( 'ac_css_files' ) )

    Here are the three original lines:

    wp_enqueue_style( 'ac_style', get_template_directory_uri() . '/style.css', array(), '1.0.1', 'all' );
    wp_enqueue_style( 'ac_media_queries', get_template_directory_uri() . '/assets/css/media-queries.css', array(), '1.0.1', 'all' );
    wp_enqueue_style( 'ac_icons', get_template_directory_uri() . '/assets/icons/css/font-awesome.min.css', array(), '4.0.3', 'all' );

    Change them to this:

    wp_enqueue_style( 'ac_style', get_stylesheet_directory_uri() . '/style.css', array(), '1.0.1', 'all' );
    wp_enqueue_style( 'ac_media_queries', get_stylesheet_directory_uri() . '/assets/css/media-queries.css', array(), '1.0.1', 'all' );
    wp_enqueue_style( 'ac_icons', get_stylesheet_directory_uri() . '/assets/icons/css/font-awesome.min.css', array(), '4.0.3', 'all' );

    That should end your child’s nightmares!
    ciao!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Theme Author acosmin

    (@acosmin)

    You are right, I’ve already submitted an update (v1.0.4) and it should get approved.

    http://wordpress.org/themes/justwrite/developers/

    Thank you for pointing that out!

    Thread Starter benshepp

    (@benshepp)

    I am happy to have helped. Its been a good WP Theme learning experience for me!

    as I use a child theme, do I need to update that to take advantage of the fix? thanks

    Thread Starter benshepp

    (@benshepp)

    @hannahstrange, Short answer: Yes, You need that mod to get your child theme to work. Otherwise your local CSS mods will never get loaded.

    Without the calls to: get_stylesheet_directory_uri(), The path to your custom CSS mods will never get selected and therefore your CSS rules will never get loaded on the site.

    Once update (v1.0.4) gets approved, (as Alex reported above) you will no longer need your mod after updating the theme. After you upgrade, be sure to go back in and REMOVE your temporary fix from your local functions.php… You won’t need to override the parent on that function anymore…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I believe I found a bug in functions.php’ is closed to new replies.