Jump to content


Photo
- - - - -

Overriding includes in a child theme

child theme overridechild theme override includes

Best Answer Simon_P , 14 June 2013 - 04:55 PM

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.

Go to the full post


  • Please log in to reply
5 replies to this topic

#1 bigtopmultimedia

bigtopmultimedia

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 14 June 2013 - 03:16 PM

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).



#2 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 14 June 2013 - 04:22 PM

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

Please Login or Register to see this Hidden Content



#3 bigtopmultimedia

bigtopmultimedia

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 14 June 2013 - 04:45 PM

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.



#4 Simon_P

Simon_P

    Messer

  • Administrators
  • 8388607 posts
  • LocationDevon
  • Framework Version:2.0
  • Country: Country Flag

Posted 14 June 2013 - 04:55 PM   Best Answer

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.



#5 bigtopmultimedia

bigtopmultimedia

    Newbie

  • Members
  • 8 posts
  • Country: Country Flag

Posted 14 June 2013 - 05:12 PM

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



#6 Rob

Rob

    One Smart Egg

  • Members
  • 13575 posts
  • LocationEast Coast, USA
  • Framework Version:The Latest, of course
  • Country: Country Flag

Posted 14 June 2013 - 08:00 PM

You're welcome.







Also tagged with one or more of these keywords: child theme overridechild, theme, override, includes