Support » Theme: Kahuna » Child theme

  • Hello,

    I created a child theme (Kahuna-child) and activated it.

    The file I needed to edit was includes/landing-page.php. Because it is not a standard WordPress file, it won’t automatically be picked up in the child theme.

    Therefore, I placed the edited file in the original theme, but I want to do it properly by placing it in the child theme.

    Would someone help me how to edit the child theme’s function.php?

    • This topic was modified 1 year, 6 months ago by may2017.
    • This topic was modified 1 year, 6 months ago by may2017.
    • This topic was modified 1 year, 6 months ago by may2017. Reason: grammar error

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Could it be achieved by just copying and pasting the following into the child theme’s function.php??

    require_once( get_template_directory() . "/includes/landing-page.php" );
    

    Did you use a plugin to create your child theme?
    I use Child Theme Configurator and had no issue with creation.

    Yes I did use the plugin to create the child theme, and the child theme is fine.

    I am asking how to edit function.php in the child theme so that I can ‘pull’ a file that is not a standard WordPress file.

    Can you please read my question carefully?

    • This reply was modified 1 year, 6 months ago by may2017.
    Moderator stephencottontail

    (@stephencottontail)

    get_template_directory() always looks in the parent theme’s folder, so you’ll want to call get_stylesheet_directory() instead, which will first look for the file in the child theme’s folder:

    require_once( get_stylesheet_directory() . "/includes/landing-page.php" );

    • This reply was modified 1 year, 6 months ago by stephencottontail. Reason: fix quote issue

    Thank you so much for answering to my question!!!!

    It worked. It worked. That’s what I needed to change when I am copying that line!!

    Thank you. Thank you. Thank you.

    I will relay your kindness to others. 🙂

    (…meaning that when I can help I will help others, too)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Child theme’ is closed to new replies.