• Resolved catalpha

    (@catalpha)


    I need to enqueue additional theme files in a child theme. Such as /media-queries.css or a php file in a subfolder (ie. /theme-child/subfolder/file.php.

    I’ve created a child theme and enqueued the style sheet, but I don’t know what the php function is to enqueue files other than style.css

    From research I think I need to use get_template_directory(), but I can’t find any examples.

    Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    From research I think I need to use get_template_directory(), but I can’t find any examples.

    Try get_stylesheet_directory()

    Thread Starter catalpha

    (@catalpha)

    What about enqueuing a .php file? in a sub directory?

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    What have you got so far?

    Evan Herman

    (@eherman24)

    This isn’t a WordPress specific question, but more of a global web development question.

    You can’t enqueue a php file. You’ll need to include, include_once, require or require_once the file. Additionally, you can use get_template_part() depending on what type of file it is you are trying to load.

    Thread Starter catalpha

    (@catalpha)

    Is there a source where I can see examples?

    Evan Herman

    (@eherman24)

    Google can provide you with some solid examples on how to use any of the aforementioned functions.

    Thread Starter catalpha

    (@catalpha)

    Example:

    I want to move:
    /basic/themify/themify-builder-templates/template-gallery.php

    to
    /basic-child/themify/themify-builder-templates/template-gallery.php

    In order to make a change in the template structure. Is get_template_part() the correct function to use in functions.php in the child theme?

    I’m using Themify Basic theme.

    Evan Herman

    (@eherman24)

    I personally do not work with any page builders, or have any experience customizing templates for them – so I’m not 100% sure.

    But from a quick Google search, the themify documentation seems to have some very helpful information:
    https://themify.me/blog/extending-builder

    Thread Starter catalpha

    (@catalpha)

    Thank you all.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘enqueue additional child theme files with functions.php’ is closed to new replies.