Answer the question
In order to leave comments, you need to log in
How to display the content of one page (body) on any other in Wordpress?
I am in contact with a project (site) on WordPress, faced with the task of how to substitute the content of one page into all others:
An example of the site structure (many sites are created according to this type):
Answer the question
In order to leave comments, you need to log in
1. Create a page where you will add content that will be displayed on other pages.
2. You create a new template for such pages.
3. In the template you call get_post_field( $field, $post, $context );
4. ...
5. profit!
Implementation methods: 1) Add to the required part of
the
get_posts template - display what is needed
data, or using the same hook we add content after or before the main entry. (See the wp hook base)
3) Create your own page template in php, display a different layout there, select the display of the desired layout on the required pages.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question