How do I find my child theme URL?

How do I find my child theme URL?

get_stylesheet_directory_uri() will return the child theme directory url, you got that bit just right. ( get_template_directory_uri() would return the parent theme directory url.) Also, if you want styles. css outputted, the first line of code will do that.

How do I find the parent theme URL in WordPress?

References

  1. get_stylesheet_directory() – file path to current theme directory.
  2. get_stylesheet_directory_uri() – URL to current theme directory.
  3. get_template_directory() – file path to parent theme directory.
  4. get_template_directory_uri() – URL to parent theme directory.

How do I find the child theme directory in WordPress?

php file in my child theme by doing this: define( ‘CHILD_DIR’, get_stylesheet_directory_uri() ); This produces a URL which is what I want since I’m using it like this: wp_enqueue_script(‘custom’, CHILD_DIR .

How to add stylesheet to a child theme?

When you need to include files that reside within your child theme’s directory structure, you will need to use get_stylesheet_directory(). Since the style.css is in the root of your child theme’s subdirectory, get_stylesheet_directory() points to your child theme’s directory (not the parent theme’s directory).

How to enqueue the parent theme stylesheet in PHP?

The recommended way of enqueuing the parent theme stylesheet currently is to add a wp_enqueue_scripts action and use wp_enqueue_style () in your child theme’s functions.php. You will therefore need to create a functions.php in your child theme directory.

Why is get template Directory pointing to parent theme?

The problem I am having is that the get_template_directory_uri is pointing to the parent theme like site/wp-content/themes/twentythirteen/myGallery/gallery_functions_include.php but I want it to point to my child theme which should be site/wp-content/themes/child-twentythirteen/myGallery/gallery_functions_include.php

How to get the parent theme in WordPress?

If you prefer to use a constant, then TEMPLATEPATH is akin to calling get_template_directory () (i.e. the parent theme), and STYLESHEETPATH is akin to calling get_stylesheet_directory () (i.e. the child theme). These constants are set by WordPress core in wp-includes/default-constants.php and basically look like this: