New Feature: Playlist Center! Pick a topic and let our playlists guide the way.

Start learning with our library of video tutorials taught by experts. Get started

Dreamweaver and WordPress: Building Sites
Illustration by

Outputting data


From:

Dreamweaver and WordPress: Building Sites

with Joseph Lowery

Video: Outputting data

Once you have working dynamic code in Dreamweaver, it's basically a series of straight-ahead copy-paste operations to integrate that code into a WordPress template page, with one possible exception. I will point out that exception, but let's start by bringing in a basic template. So I am going to go my Exercise Files/ Chapter 5/05_03 and open up planet.php. Let me switch to Code view, where you can see that I already have this set up as a template with the name of planet, and it's a basic page that has the WordPress loop in it.

Watch this entire course now—plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Dreamweaver and WordPress: Building Sites
1h 42m Intermediate Feb 24, 2012

Viewers: in countries Watching now:

In this course, author Joseph Lowery shows how to create a robust WordPress-based site using Dreamweaver. The course lays out the essentials of planning a site, explains how to implement custom sidebars, and demonstrates building page templates. The course also explains how to integrate PHP functionality and extend the WordPress database.

Topics include:
  • Understanding development environment requirements
  • Working with existing WordPress content
  • Handling standard pages
  • Managing full posts
  • Coding a basic template
  • Adding a custom sidebar
  • Working with WordPress functions
  • Inserting PHP code in posts
  • Including a recordset
  • Outputting data
  • Linking to dynamic pages
Subjects:
Web CMS
Software:
Dreamweaver WordPress
Author:
Joseph Lowery

Outputting data

Once you have working dynamic code in Dreamweaver, it's basically a series of straight-ahead copy-paste operations to integrate that code into a WordPress template page, with one possible exception. I will point out that exception, but let's start by bringing in a basic template. So I am going to go my Exercise Files/ Chapter 5/05_03 and open up planet.php. Let me switch to Code view, where you can see that I already have this set up as a template with the name of planet, and it's a basic page that has the WordPress loop in it.

I am going to go ahead and save this, so I can put it within my theme, click Site Root in the Save As and drill down to wp_content/Themes/tpa. And we can still keep it as planet.php. No need to update the links. And let's close out that initial PHP file. So now, I'm am going to open up the planet_comp page that we worked on in the previous video, and that's located in my site root, so let me open that up. This has all of my PHP code that you'll recall we used to set up the dynamic data here that's in this table.

So first I'm going to copy the PHP code and paste it from the planet_comp file to my planet.php template file. So let's go into code, go up to the top of the page, and I am going to grab everything from the top all the way down to the DOCTYPE. Make sure I get that last PHP closing bracket there, copy all of that, switch to planet.php. And normally on a PHP page, the PHP server- side code appears above everything else.

With WordPress template files it has to be after the template name, so let's go past that. And because the header has some opening information as well, let's put it after the header, so I will paste that in. Now before we bring in the content, we have one more bit of structural PHP code to integrate. So I am going to go ahead and move down to the bottom of the page and switch back to planet_comp.php, and move down to the bottom of that page. And here you see the code that Dreamweaver inserts to close out the opened record set.

So let's copy that final code block, head back to planet.php, and we will put it in at the bottom of the page. Okay, our structure is now in place. Let's go back and get some content. Head back to planet_comp.php, and I am going to go to Split view to make this a little bit easier. In this case I want just a table; I don't want my little header there. So I am going to put my cursor within the table. Here it is, on line 60. I want just the table. I don't want the H1 tag. So I am going to put my cursor within the table tag and then use the Select Parent Tag option to grab all of that code.

You want to make sure to grab this in Code view because you are going to be pasting in the code. I'll copy it, move over to planet.php, and I want to put this after the loop ends, which is right after endif here. Paste that in and there is our table. By pasting the dynamic data below the WordPress post code, we make it possible to include any bit of static text we want, just by entering it into the WordPress page. Okay, we are ready to save our template and test it.

Let's head over to WordPress and add a new page. So let's enter Planetary 411, and for now I am just going to put in some placeholder content, "Intro goes here..." I am going to set the Template to Planet and then click Publish. Okay, let's take a look at our page. Well we see now that we have our basic information, our intro, and the start of our table, but no dynamic data.

Remember the recordset filter? Let's add the URL variable and value to the web address and see what happens. So I will click into the address bar and then add an ampersand, because this is another name value pair that we are adding to the URL parameters, and type in id=, let's go with 4. Looks like our record set data is fully integrated into the template page. Now you're ready to see how to link to these dynamic pages from within the WordPress site.

There are currently no FAQs about Dreamweaver and WordPress: Building Sites.

 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.
Upgrade now


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ.

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

join now Upgrade now

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Dreamweaver and WordPress: Building Sites.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferencesfrom the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Notes cannot be added for locked videos.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.