Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Build a WordPress Theme Preparing to Code WordPress Templates The HTML Template

How do you get PHP to run in a web browser?

We are working with header.php and footer.php, we add the following code into the .php files:

<?php
    wp_title('_', true, 'right');
    bloginfo('name');
?>

We then run them in a web browser? When I try to load localhost/allisongrayce.com I get the Wordpress site; unlike the pages in the video.

7 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Can you post up a screen shot of what you're getting please. I need a little more info to help trouble shoot.

If you echo out a test hello world string does it show up properly?

How do I attach a file here?

Level 1: Content Strategy with Wordpress, it is about setting up WP and creating a WP site for allisongrayce.com, I did levels 2 & 3, then I got to level 4; in level 1, WP has been installed, then when I download the files from the exercises in level 4, the folder name is not allisongrayce.com the parent dir is wp-theme-devemlopment-stage-04 exercise files. How do I setup the file structure here?

In the video you show that you are going to localhost/allisongrayce.com. The parent dir is: wp-theme-development-stage-04 for the downloads in the level 4 section, it has a completely different parent dir than the allisiongrayce.com that we create in level 1 and install WP for the Content Strategy with Wordpress. If I were to move header.php and footer.php into allisongrayce.com when I go to view we are in a WP installation and not a plain ol' web browser shown in the video: Adding Titles & Meta Tags. You demonstrate after you add the code to header.php and footer.php.

I have a new folder of items downloaded from level 4. So, then I dragged the exercise files into my HTDOCs folder for MAMP. Now, I have an improvement. I see no WP since I broke something on purpose. I moved my allisongrayce.com that I originally installed WP on out of htdocs. Then, I was able to get closer to what you show in the video, the big exception is that the WP associated files show up still. In the video (add titles and meta tags) thedemo does not have these files WP files shown just plain ol' PHP.

When, I try to look it in the browser I have all this WP files and assets associated with the loaded page but is now not rendering the Word Press look, the content is there. It does not at look like the page you view in your video because it display WP assets and associated files. In the video your file is clean of any WP associated files and does not display them.

How do we set up the demo environment that you talk about in Level 4? I have had a disconnect here at this stage. I need some clarity as to how we work with the files. I know the goal is to create a WP site from existing HTML prototype shown in Level 1. In level 4, the html prototype files are no longer there.

I need to send you screenshots. I don't see a way to do this here.

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Hi Amir Siahpolo,

Couple of things:

  1. Do you have a working install of WordPress up and running? If not, try checking out our course on Local WordPress Development
  2. For posting images you will have upload them online first. I like using a service like CloudApp, but there are others too. Then you would use the Markdown format (see Markdown Cheatsheet beneath the textfield when you post) to link to or embed the image.

Thanks!

1. Yes, in level one I did the complete installation of WP, including adding the custom fields, posts, page, etc. I believe when you say demo files to down, you mean the project files that come with each section, here we have a bunch of image files. Do these get inserted into the WP pages and sections that I just installed?

2. Level 4: Video instruction Add Title & Meta Tags http://cl.ly/image/0l240x1L401D

Into the video where you render a web browser page after adding the code to the front.php & footer.php file. I believe the file that was loaded is the front-page.php for allisongrayce.com. I do not see the Word Press skins here now, please see the screen shot.

http://cl.ly/image/091Y2l3a1G0p

Yes, that was local. I have localhost/allisongrayce.com and now I moved the file structure for that local server into Sublime2. Last time I missed this step completely. How do we integrate our project files with this installation now?

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

The project files get added from within the admin area as the content for the custom post types we setup.

In the code snippet you linked to, it looks like you're missing the closing semi-colon at the end of the line and there is an extra coma in there unless you're adding a third parameter.

As for the skin, it doesn't look like you've gotten to the point in the course where that's added. It comes a little bit later.

So, we go into the wp-content folder and copy the header.php and footer.php into the wp_portfoilo folder? Or, is there a mechanism in the admin portal in the WP environment? I think we created the wp_portfolio folder in level 2 of the Building Theme with WP tutorial.