0

Hi I would like to add a custom div on bottom of every page. I am using genesis framework with child theme enterprise-pro

I would like to change the child theme page.php file but I am not able to find it.

When I go to wp-content/theme/enterprise-pro there are only these files http://prntscr.com/mmpmwb

Any idea how to add this div to every page without using a plugin?

PROGRESS

So I looked up the page.php in the parent theme and it shows me this code ....

So I am little bit confused now where to find the real page.php

I have even installed the plugin "what the file" to find the real php but the plugin is showing me the page.php of the parent with the code bellow.

Any ideas where to go from here?

https://my.studiopress.com/themes/genesis/ */

// This file handles pages, but only exists for the sake of child theme forward compatibility. genesis();

1
  • I can help you... but I don't know a lot of things... first... 1. you want it on every page(post format) (not on every post, archieve pages, user page.. etc)?
    – Brada
    Feb 22, 2019 at 19:12

1 Answer 1

1

If a child theme does not have a file (i.e. page.php), WordPress looks in the parent theme for that file. That's much of the reason for how child themes exist - to override specific content of the parent, but not to override anything else.

So in this case you are wanting to add an additional override. You could go copy page.php from the parent to the child and then modify it as you wish; for instance, by adding a div to the bottom of it.

There are other ways to add content to each page, for instance you could tie in to the wp_footer hook. However copying the parent theme's file you wish to modify to your child theme and making the change there is probably the most fundamental way of using child themes, and will allow you the most flexibility going forward, so that's where I would suggest doing it.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.