shortcode - How to add a same div on every page

admin2025-06-02  3

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

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?

/ */

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

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/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/themes/genesis/ */

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

Share Improve this question edited Feb 22, 2019 at 18:41 Marek Kalina asked Feb 18, 2019 at 14:20 Marek KalinaMarek Kalina 11 bronze badge 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 Commented Feb 22, 2019 at 19:12
Add a comment  | 

1 Answer 1

Reset to default 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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748876043a314452.html

最新回复(0)