Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm working with Google Chrome for debugging and a lot of times i cant remember where i initially implemented codes for different things...

I am looking for a php code that i inserted to one of my Wordpress files but i cant remember which.

Is there a way to find out a location of a selected code in 'Inspect Element'?

For example if i need to find out a CSS property, the debugger tells me which css and where it is..how can i do that for html codes and php?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

You cannot see PHP code on the client side. When you request a PHP site from your server, the server translates your PHP code into whatever the PHP script outputs (e.g. through echo commands) and you'll just see that instead, or the HTML interleaved with PHP. You will never see the PHP source code.

To see the HTML code for a certain element, open the Inspector and click the loupe at the bottom.

Then, hover over the elements on the website you'd want to inspect and click them. The HTML source will be highlighted.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.