Archived

This topic is now archived and is closed to further replies.

  • 0

Overriding includes in a child theme


Question

Posted · Report post

Is it possible to override a file from the /pagelines/includes folder in a child theme? I have tried it and it doesn't seem to work.

If the normal method of copying the file into the child theme folder doesn't work, how would I change the grid() function in library.layouts.php to include an ordinal for each box? (Note, the php code to achieve this isn't the problem, just how to get around pagelines "underriding" my customisation).

Share this post


Link to post
Share on other sites

5 answers to this question

Posted · Report post

Does it have to be the case that the normal override system doesn't work? Normally a duplicate of a file in a child-theme takes precedence over its parent.

What do you mean by 'normal override system'? Are you referring to WordPress and template files? That only works for actual WP files, like header.php footer.php functions.php etc, not custom framework files.

 

Create a sections folder in the child theme and copy the boxes folder into it. Then edit away.

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

 

It doesn't seem like there is a simple solution for what you're trying to do.

 

The grid function has no filters, so, easiest way is to use a custom boxes section then, rather than using grid() use his own custom function.

 

We unfortunately cannot support editing core files.  We'll help with sections, languages, but the /includes folder is definitely a set of core files.

 

If you still wish to proceed in that direction, you'll need to hire a developer to create a new class and place it where it will not be overwritten.  I'd recommend contacting one of our Pros

Share this post


Link to post
Share on other sites

Posted · Report post

Does it have to be the case that the normal override system doesn't work? Normally a duplicate of a file in a child-theme takes precedence over its parent.

Share this post


Link to post
Share on other sites

Posted · Report post

Ah, ok - I was under the impression that it could work for any file in a child-theme folder. Thanks for the responses.

Share this post


Link to post
Share on other sites

Posted · Report post

You're welcome.

Share this post


Link to post
Share on other sites