1

A very basic question:

I'm creating a WordPress Page Template.

I have a file: pagetemplatename.php

Obviously the file has .php on the end of the name: Is everything in this file php code? Or can CSS and other code go in this file?

Richard
  • 461
  • 1
  • 6
  • 14
  • 2
    you can use CSS, JS, HTML too. – xkeshav Jul 30 '12 at 19:04
  • Not sure why this is getting downvoted. If you're going to downvote this question, you should explain your reasoning. – Brad Jul 30 '12 at 19:06
  • 1
    I upvoted to fix that :P, this is a help forum not a snob forum – Branden S. Smith Jul 30 '12 at 19:07
  • 1
    @BrandenStilgarSueper, pity upvotes don't "fix" blind downvotes. Upvoting the question means you think it's useful and it shows research effort. – Adi Jul 30 '12 at 19:11
  • @Adnan and the down-vote indicates that *"This question does not show any research effort; it is unclear or not useful"*. This question is both clear and useful, even if a major research effort was not undertaken. Two out of three ain't bad. – Matt Jul 30 '12 at 19:20
  • 2
    @Matt, don't get get me wrong I didn't downvote it. But if you check the OP's questions you'd see that he's treating Stackoverflow as his personal "smart search engine". Yes this question is clear, but it's not useful and it doesn't show research effort. – Adi Jul 30 '12 at 19:35
  • @Adnan "useful" is fairly subjective. For a noob it's useful. For someone who bills US$150/hr for their expertise, it's not. +1 for not downvoting. – Matt Jul 30 '12 at 19:37

3 Answers3

6

Your file could look like this:

 <html>
   <body>
     <?php some php code ?>
     <h1>test</h1>
     <?php some more php?>
   </body>
 </html>

The entire file could be php, or you could indicate where you want php to be executed using the <?php ... /> tags.

Check out the intro here.

Ryan
  • 26,884
  • 9
  • 56
  • 83
3

Scripting Language always needs markup language to display. so whatever you can done in HTML, you can do the same on .php page

you can write

CSS,JS and HTML

xkeshav
  • 53,360
  • 44
  • 177
  • 245
1

You can both separate and combine your PHP / HTML / CSS / Javascript / XML / etc. pages.

You can put your PHP code directly between your HTML tags, or use some sort of templating system to keep your back end code and design separate.

Brock B.
  • 367
  • 1
  • 13