Join Morten Rand-Hendriksen for an in-depth discussion in this video Using attachment pages, part of WordPress Essential Training.
As mentioned a couple of times now, that all image items have their own respective Attachment Pages. I also said these pages are not well supported by all themes, so their use is not always recommended. That said, Attachment Pages, when supported by your theme and used correctly, can have an important function for your site. Both in terms of content management, and in terms of getting noticed and indexed on search engines and social media. So let's take a closer look at Attachment Pages and what we can do with them.
First of all, let's just take a look at an Attachment Page so you know what I'm talking about. I'll pick one of my vitamin bottles, and then click on View Attachment Page to jump to the front end and see my Attachment Page. The 2015 theme supports Attachment Pages and gives us some basic functionality. So here you see the Attachment Page displays the Title of the attachment, followed by the attachment itself, and then a Caption, if there is a Caption. And if I added more information, it would be displaying along side here. You'll notice that because we are now on an Attachment Page, I also have extra information, like the size of the image.
And if I click on that, I'll see the full-size version of the image. And I can navigate to the next and previous image. Now, this might seem a little odd. What exactly am I navigating back and forth between? Well, to understand that, you need to look at the URL for this attachment image. You'll remember from earlier, that I added these vitamin bottle images to a specific post. Now if you look up in the URL, you'll see that this multivitamin here is actually a sub-item of a specific post introducing H+ Sport supplements.
And when I navigate back and forth here, I'm actually navigating back and forth in the post. So these are the media items that are attached to that particular post. So you remember in the previous movie, when I said you could detach a media item from one post and attach it to another? Well this is where that would have an impact. We are now scrolling through the items that were uploaded and attached to a specific post. But here's the thing, you can do more with Attachment Pages than simply scroll through them.
So I'll open the same image again, only this time I'll click on Edit More Details. This takes me to a view that looks a lot like the regular post editor, except in place of the regular content editor, we have the image, or the media item. From here, you can see all the same information. We have the Caption, the Alternative Text, and then we have the Description field. Only this time we can actually use some basic HTML tools. And this is where things get really interesting. In this Description field, I can enter some text.
And then go up and Update my attachment post. Now I can go and view it. So I'll View Attachment Page from the WordPress toolbar. And now when I scroll down, you'll see the text I added appears down here, just like a regular post. And it gets better. You can actually add a full post here, including images and other HTML elements. So if you want to, you can create an immensely, immersive experience in your attachment pages, provided your theme supports them. So I'll give you an example of how this would look and why it's so valuable.
Consider this page, the Our People page that I created earlier. Here I have all the bios for all these different people, and you can scroll up and down and see all the images and everything, and that's fine. And if someone happens to do a Google search, for example, Henry Twill, they might come upon this image and they would then be led to the Attachment Page for that image. The problem, of course, is if we actually go and look at the attachment page for this image, we don't get much information. Or do we? You see I've thought this through a bit, and figured out that if I'm going to add an image of this guy, who is the CEO and Founder of a big company, I should really provide some more information.
So I took the bio information from this Our People page, and I attached each bio, for each of these people, to their respective Attachment Pages, for their respective images. That way if someone happens to find the image of this guy on Google search or somewhere else, they'll be led to the Attachment Page for that image and get more information. From here they can also navigate back to the original post, if they want to, to read more information. But the point is that all that information is now attached to the image.
So now that I've activated that feature, I can go in and edit this page. And make sure that each of my images are linking back to the Attachment Page. So I'll scroll down here, say Link To Attachment Page. Update. Scroll further down. Link To Attachment Page, and keep doing that for each of my images. And when I update this page now, go back to view the page.
You'll see if I click on any of these images, I'm taken to the respective person. I can see a much better and bigger photo of them, along with their bio and I can navigate through all the people that work for the company. And now you see why this is important, because you can imagine if you upload an image gallery and you want to provide more information about each of the images. You can do that in the Attachment Page for the images. And what's even cooler, if you scroll to the bottom, you'll see Attachment Pages have comments. So if you use this to display image galleries or something like a slideshow or slides from a PowerPoint presentation, you can use this to provide more information and allow people to leave comments and even share this information with other people.
Attachment Pages can be exceptionally useful for your site. You just have to make sure your theme supports them, and that you have a consistent strategy on how to deploy them.
Note: This course covers WordPress 4.3. We will update the training as WordPress evolves.
- Creating posts and pages
- Formatting text
- Publishing and scheduling posts
- Adding images, audio, and video
- Bulk editing posts and pages
- Customizing themes and menus
- Using widgets
- Extending WordPress with plugins
- Editing users profiles
- Configuring settings
- Getting new readers
- Keeping WordPress up to date and secure