Site logo

Archived topic

get_template_directory_uri of child-theme links to main-theme

1 reply · Started by Forum User on December 2, 2017

Viewing posts 1–2 of 2

Hi Tom

After working several weeks with your theme I'm still totally convinced that I made the right decission to buy GeneratePress.

But now I'm struggeling the first time with the child-theme you are offering. I tried to add some PHP-Code to the childs function.php and I tried to load some own additional css with this function:

add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
function enqueue_my_styles() {
wp_enqueue_style( 'fontello', get_template_directory_uri().'/fontello-ee6ff678/css/fontello.css',false,'1.0');
}

unfortunatelly it seems like get_template_directory_uri() doesn't point to the right theme-folder - in HTML-Code I got this result:
<link rel='stylesheet' id='fontello-css'
href='..../wp-content/themes/generatepress/fontello-ee6ff678/css/fontello.css?ver=1.0'
type='text/css' media='all' />

although it should load from .../themes/generatepress-child/...

any idea?
-> I googled arround a bit and I just wondered about the separate
child-theme-folder - Wordpress told me today, that I'm not useing a
child-theme... I found out, that the proper way of creating a
child-theme is to create a "child" folder underneath the
main-theme-folder... did this change in last recent versions?

Hi there,

get_template_directory_uri() points to the parent theme folder.

You want to use get_stylesheet_directory_uri() instead.

Let me know :)

This archived topic is closed to new replies.