Tagged: ,

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24441

    Hey Kriesi-Team,

    thank you so much for checking this thread out!

    I could reeeally need help with a child theme for Shoutbox and will (try to) describe my issue as briefly as I can:

    I modified the helper-featured-posts.php file inside the /includes/ folder and copied the folder and the helper file to the child theme.

    The modifications won’t get recognized in the front end.

    I tried to figure out the path that makes sure that helper file gets included and I tried to copy other files to the /includes/ folder of my child theme as well, but to no avail.

    Can one of you awesome gods and goddesses please help me and let me know where I’m wrong?

    Disregard the next paragraph since I got a workaround for that, but maybe I’m seeing this wrong or maybe it even helps…

    I had troubles modifying the css files of the child theme as well, but that seems because

    <?php echo get_bloginfo('template_url'); ?>

    does not fetch the child theme’s URL but the main theme’s URL. So if I use a child theme’s /css/ folder it still will fetch the main theme’s files instead of the child theme’s. I did solve that by adding an enqueue to the functions.php for my new css files which leaves me with duplicate code.

    I think to allow the main theme to recognize the correct css file in the child theme I would need to modify the main theme’s code to something along the lines of

    $path = locate_template(array(“some/path/…”), false, false);<br />
    include_once($path);

    but that would mean to copy every file to the child theme and change every get_bloginfo code to this code, which would defeat the purpose of a small customized child theme and would prevent me from updating the whole theme again. So meh.

    If anybody knows why I’m stuck I would appreciate it a lot!

    [edit] – this is the first thing that really doesn’t work – what worked flawlessly are all the loops inside the includes folder for example, and I could find a way for that css issue, but that slider file just won’t work :(

    Thank you so much,

    you’re the best!

    Mel

    #123492

    Unfortunately you can’t overwrite existing files simply by copying them to the child theme folder. This only works with functions.php and style.css. All other files (which are included with require_once(), etc.) require a manual inclusion. In the main theme functions.php comment out (or delete) following line:

    require_once( 'includes/helper-featured-posts.php' ); 			// holds some helper functions necessary for featured posts

    and add the same code to your child theme functions.php. Then the theme will load your modified helper-featured-posts.php from the child theme folder.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Child Theme File Paths’ is closed to new replies.