Black Friday sale! Get up to 25% off GP Premium! Learn more ➝

[Support request] get_template_directory_uri of child-theme links to main-theme

Home Forums Support [Support request] get_template_directory_uri of child-theme links to main-theme

Home Forums Support get_template_directory_uri of child-theme links to main-theme

  • This topic has 1 reply, 2 voices, and was last updated 6 years ago by Tom.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #440015
    zzz_shop_generatepress@p000326496.pwhost.de

    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?

    #440598
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    get_template_directory_uri() points to the parent theme folder.

    You want to use get_stylesheet_directory_uri() instead.

    Let me know 🙂

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.