On one of my page templates I need to include the contents of several other pages. For example, if my page template is called Fruit, I need to pull in page content from pages named Apple, Pear, Orange, Lime, etc. This gives my user the ability to edit Apple and Lime individually from admin area.
I'm trying to use get_page_by_title() to pull in these sub pages, but that function only seems to want to work once per page. The first time I call
get_page_by_title('Apple')
works perfectly. When I later call
get_page_by_title('Lime')
it displays Apple again. Is this function limited to once per page, or am I doing something else wrong?
Edit: It seems that no matter what title I pass to get_page_by_title() it will always get the content of the current page. So if I'm on example.com/fruit and call
get_page_by_title('Apples')
with in the page, it will always display the content from Fruit. Not Apples.