Join Joseph Lowery for an in-depth discussion in this video Accessing dynamically related files, part of Dreamweaver CS6 and WordPress 3.8: Core Concepts.
And you'll notice, as before, that the page is blank. Let me switch over to Split view. And here the code is now comprised of a fair amount of PHP comments. And if I scroll down, you'll see there's a define function on line 14. And one PHP require statement on line 17. Now, let's open up the file noted in the require statement, wp-blog-header.php. So, I'll see it over here in my Files panel, double-click on it, and you'll see again, there's not a whole lot of code on that page.
But rather, it's kind of a switch statement that allows WordPress to load in one file or another. Now, the way that WordPress works is that it will continue down this path of bringing in nested PHP files one after the other. To gain access to them all, you'll need to use the dynamically related files feature. Let me close that wp-blog-header file and concentrate on index.php. Now, up here in the info bar, you'll see a message that says, this page may have dynamically related files that can only be discovered by the server.
And then there are a couple of link options, Discover and Preferences. Now, in Preferences, under the General category, you can set the option so that the discovery of dynamically related files happens automatically. I tend to like it, so that you still have to do it manually each time. Because then, if I'm not interested in seeing the additional files up there, I don't have to worry about them. So, let's click on discover, and when I do, I get a script warning from Dreamweaver saying that it was basically going to run this through the server and if you want to proceed, click Yes.
Well, we definitely do, so well click Yes but before I do, I'm going to go ahead and click Don't warn me again, because it's something that we'll be doing a lot and there's no need to see this dialog box again. Now, you can see, across the top, a whole range of files that have been dynamically discovered. In fact, there are so many dynamically related files that they extend off the page. I can click the scroll button over here on the right and scroll quickly from right to left and then, on the other side, go back if I need to.
And then, go back on the other side if I need to. If I'm trying to find a particular file, for example, well obviously, there's an awful lot of files. You can see them all, well, as many as will fit on the screen, by clicking the Show More icon here on the right hand side of the document window. And there you see the first group of files. I'll go down so that we can scroll up through the files, clicking on the arrow, we'll scroll all the way to the bottom. As you can see, there are just an amazing number of files that are interconnected here.
WordPress uses 97 different files in its default page, all of which are available to you in Dreamweaver. Now, you can access them directly by clicking on any of the files here and they'll just show up in code view. If you want to dive in for a closer look, feel free to click on Code to expand the page. And then start to look at the various functions that are found on the page. Let's take a look at wpload.php for example. And after the initial comment, you can find function after function.
Now, there are other types of pages, of course. There is a CSS style page, as well as various XML files. The dynamically related files feature is really a critical Dreamweaver one when working with WordPress or any CMS. In the next lesson I'll show you how to target specific files and file types.
- Setting up WordPress locally
- Establishing your Dreamweaver CS6 site
- Adding and editing posts and pages
- Customizing WordPress themes
- Building responsive layouts
- Extending WordPress editable pages
- Using and styling WordPress plugins
- Integrating Spry functionality
- Publishing your WordPress site with Dreamweaver
- Personalizing and enhancing WordPress
Skill Level Intermediate
Author update on April 4, 2014:
WordPress 3.8.2 is now available from wordpress.org. The update focuses on security issues and should not impact this course in any way. A much bigger release, 3.9, is currently a release candidate and will likely go live later in April. I'm currently evaluating what impact v3.9 will have on this course.