Finding the template used to build a WordPress page.

Is there a way to tell from a WordPress page what template the page was built from. In my case, there's a page at mysite.com/checkout and I happen to know that the template used to build this page is at wp-content/plugins/woocommerce/templates/checkout/form-checkout.php. But how could I have known that just from poking around the page with Chrome Dev Tools?

Thanks
stevaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jason C. LevineNo oneCommented:
If you have access to the admin login for the site, sure.

From looking at just the front end? You should be able to get a clue from the body class.  This is what one of mine looks like (template bolded for emphasis):

<body class="page page-id-44821 page-parent page-template page-template-template-healthy-sooner page-template-template-healthy-sooner-php desktop custom-header full-width-content no-js">
0
stevaAuthor Commented:
I do have access to the admin login for the site. In that case, where do I find the template for the various pages?

Thanks
0
Jason C. LevineNo oneCommented:
Appearance | Editor
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

stevaAuthor Commented:
I didn't see and Editor option under Appearance in the Dashboard.

But in any case, thinking more about my question, I don't think it's possible see anything in a browser that will tell you what template was used to build some portion of a page, say a checkout form.  Those templates are all consumed by the PHP and what you see on the browser is the result of following the template instructions.
0
Jason C. LevineNo oneCommented:
I don't think it's possible see anything in a browser that will tell you what template was used to build some portion of a page, say a checkout form

It depends on exactly how the page or application is built.  Some will be as you say, others will use a more straightforward approach like my sample.  It's not a black and white issue.  For WooCommerce, clearly it's the former.

I didn't see and Editor option under Appearance in the Dashboard.

Either you don't have full administrator privileges (e.g. someone messed with the capabilities) or you're logging in as an editor.
0
eemitCommented:
For custom page templates, you can see page template name (not page template file name) in:
Edit Page Screen / Template or in
Pages / Quick Edit / Template
0
stevaAuthor Commented:
Pages / Quick Edit / Template shows "Default template" for most all my pages but I know that the checkout page, for example, is built from many templates controlling various area of the page and its those templates that I wanted to find.  But as I mentioned above, I don't think this is going to be possible because those templates were "consumed" by PHP to create the page and no trace of them is left by the time the browser displays the results.
0
Jason C. LevineNo oneCommented:
If the pages are generated from a user action and parsed by a plugin, yes.  You would need to go through the plugin files to determine what's what.  Plugins | Editor might help with this but it traverses folders in a strange way.

Better off to download the plugin folder via FTP and pick it apart that way.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WordPress

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.