Integrating physical pages with database pages


I’ve tried searching everywhere for this but could not find it anywhere. Regardless I hope someone knows how this is done, because it would be insanely helpful to know.

I’ve recently taken over a wordpress site from a different developer and cannot figure out how they did one thing. Within the dashboard, there is a page, let’s call it portfolio. However, when you click on the page in the dashboard, the content is absolutely empty. Within the source code, there is a page named like page-142.php which contains the HTML/PHP content for the portfolio page.

However, when visiting the page in your browser, it displays as even though the file itself is named page-142.

The PHP file of course has the get_header and get_footer tags.

If anyone has a clue how this is done, an answer would be really appreciated.


it sounds like it was a custom template.
if so when you go to the empty page called portfolio in the page attribute window (edit level of the page in wp-admin) you should see that is has a template selected.
if that was so the page in admin would stay blank, but display the content of page-142.php while still retaining the name portfolio.
a second way to check is to look a the top of page-142.php does it have in the headers something like

 * Template Name: Whatever
get_header(); ?>

That means that is is a custom template.

In WordPress, the page.php template is the default for any page. A template name page-{number}.php is a template for a specific page with that id number. A slug can also be used to identify a page (ie: page-portfolio.php). Though, slugs can be changed so ID numbers are more reliable. The edit links in the admin contain the page id in the query string. It is possible to hover over the links in the manage screen to find page id’s.

For more information, read about template hierarchy on WordPress:

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.