概述
Do you want to organize WordPress files in the media library folders?
您是否要在媒体库文件夹中组织WordPress文件?
By default, WordPress automatically creates folders in the media library based on year and months. However, some users may want to create their own custom folders for different media files.
默认情况下,WordPress根据年份和月份自动在媒体库中创建文件夹。 但是,某些用户可能想为不同的媒体文件创建自己的自定义文件夹。
In this article, we’ll show you how to easily organize WordPress files in custom media library folders.
在本文中,我们将向您展示如何轻松组织自定义媒体库文件夹中的WordPress文件。
为什么要组织媒体库文件夹中的文件? (Why Organize Your Files in Media Library Folders?)
Normally, WordPress stores all your images and other media files in the /wp-content/uploads/ folder. To keep it structured, all files are stored in folders organized by year and month.
通常,WordPress将所有图像和其他媒体文件存储在/ wp-content / uploads /文件夹中。 为了使其结构合理,所有文件都存储在按年和月组织的文件夹中。
https://example.com/wp-content/uploads/2020/07/
https://example.com/wp-content/uploads /2020/07/
This works perfectly for most websites. However, some users may want to get better control on how WordPress stores media files.
这非常适合大多数网站。 但是,某些用户可能希望更好地控制WordPress如何存储媒体文件 。
For instance, a photography website may want to organize WordPress images by topic, location, or event folders. Similarly, a portfolio website may want to organize their media uploads by type, client, industry, and more.
例如, 摄影网站可能希望按主题,位置或事件文件夹来组织WordPress图像。 同样, 投资组合网站可能希望按类型,客户,行业等来组织其媒体上载。
This allows them to easily browse their media files. At the same time, it improves image SEO, as you can now add keywords in your image file URLs which makes URLs more meaningful.
这使他们可以轻松浏览其媒体文件。 同时,它还改善了图像SEO ,因为您现在可以在图像文件URL中添加关键字,从而使URL更有意义。
Having said that, let’s take a look at how to easily create folders to organize your WordPress media files.
话虽如此,让我们看一下如何轻松创建文件夹来组织WordPress媒体文件。
如何在媒体库文件夹中组织WordPress文件 (How to Organize Your WordPress Files in Media Library Folders)
First, you need to install and activate the Media Library Folders plugin. For more details, see our step by step guide on how to install a WordPress plugin.
首先,您需要安装并激活“ 媒体库文件夹”插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。
Note: The free version of the plugin only lets you create up to 10 folders. You will need to upgrade to the pro version if you want to make more.
注意:插件的免费版本最多只能创建10个文件夹。 如果您想获得更多,则需要升级到专业版。
Upon activation, the plugin will add a new menu item labeled ‘Media Library Folders’ in your WordPress admin sidebar. Clicking on it will open plugin’s folder view showing all the folders inside your WordPress upload directory.
激活后,该插件将在WordPress管理侧栏中添加一个名为“媒体库文件夹”的新菜单项。 单击它会打开插件的文件夹视图,其中显示WordPress上传目录中的所有文件夹。
From here, you can create new folders and add files to them. You can also move, copy, rename, or delete your files.
在这里,您可以创建新文件夹并向其中添加文件。 您还可以移动,复制,重命名或删除文件。
We’re going to create some new folders and add images to them.
我们将创建一些新文件夹并向其中添加图像。
To create a new folder, simply click the ‘Add Folder’ button and then type in the name you want to use for that folder.
要创建一个新文件夹,只需单击“添加文件夹”按钮,然后键入要用于该文件夹的名称。
Tip: You cannot use spaces in folder names. Instead, use hyphen or underscore to separate words if needed.
提示:您不能在文件夹名称中使用空格。 相反,如果需要,请使用连字符或下划线分隔单词。
It’s also possible to make subfolders within folders, if needed. To create subfolders, simply click on the parent folder to select it, and then click on the ‘Add Folder’ button.
如果需要,还可以在文件夹中创建子文件夹。 要创建子文件夹,只需单击父文件夹将其选中,然后单击“添加文件夹”按钮。
We created two subfolders for our ‘Landscape-Photos’ folder. They are ‘Forests’ and ‘Mountains’. To view a subfolder, you need to click on the small arrow to the left of the main folder:
我们为“ Landscape-Photos”文件夹创建了两个子文件夹。 它们是“森林”和“山”。 要查看子文件夹,您需要单击主文件夹左侧的小箭头:
To add files to your folders, simply click on the folder then click the ‘Add File’ button. After that, go ahead and upload as many files as you want.
要将文件添加到文件夹,只需单击该文件夹,然后单击“添加文件”按钮。 之后,继续上传所需数量的文件。
Once you’re done uploading files, you’ll see them on the screen as thumbnails with the filename below:
上传完文件后,您会在屏幕上以缩略图的形式看到文件,其文件名如下:
It’s easy to add your uploaded files to your posts or pages. You can add them just like any other files that you’ve uploaded to the media library:
将上传的文件添加到帖子或页面很容易。 您可以像上载到媒体库的任何其他文件一样添加它们:
在媒体库文件夹中移动和复制文件 (Moving and Copying Your Files in Media Library Folders)
What if you need to move a file to a different WordPress media library folder? It’s easy to move it or copy it using Media Library Folders.
如果您需要将文件移动到其他WordPress媒体库文件夹该怎么办? 使用媒体库文件夹很容易移动或复制它。
Moving an Image to a New Folder in the Media Library
将图像移动到媒体库中的新文件夹
To move an image or any other file, simply check that the move/copy toggle is set to ‘Move’ and then drag the image to the correct folder.
要移动图像或任何其他文件,只需检查“移动/复制”切换开关是否设置为“移动”,然后将图像拖到正确的文件夹中即可。
Tip: Your mouse pointer should be on the new folder, as shown below. The small thumbnail of the image is just showing you what you’re moving, not where you’re moving it to.
提示:鼠标指针应位于新文件夹上,如下所示。 图片的小缩略图只是向您显示您要移动的内容,而不是您要移动的位置。
In this example, a mountain image was incorrectly placed in the Forests folder. We are moving it to the Mountains folder.
在此的示例山图像被错误地放置在森林文件夹中。 我们将其移至“山脉”文件夹。
Copying an Image to a Different Folder in the Media Library
将图像复制到媒体库中的其他文件夹
To copy an image, set the move/copy toggle to ‘Copy’, then go ahead and drag the image as before. Here, we are copying an image of a bird and flower, so that it’s in both the ‘Bird-Photos’ and the ‘Flower-Photos’ folders.
要复制图像,请将“移动/复制”开关设置为“复制”,然后继续像以前一样拖动图像。 在这里,我们正在复制鸟和花的图像,以便使其同时位于“鸟照片”和“花照片”文件夹中。
This time, your original image will stay in place. Your image will be duplicated so that it can be present in both folders.
这次,您的原始图像将保留在原位。 您的图像将被复制,以便可以同时存在于两个文件夹中。
重命名媒体库文件夹中的文件和文件夹 (Renaming Files and Folders in Media Library Folders)
You can easily change the filename with the Media Library Folders plugin. First, find the file you want to change and click the checkbox below it. Next, click the ‘Rename’ button at the top of the screen.
您可以使用“媒体库文件夹”插件轻松更改文件名。 首先,找到要更改的文件,然后单击其下方的复选框。 接下来,点击屏幕顶部的“重命名”按钮。
After that, type in the filename you want to use. Image filenames can have a small impact on your WordPress SEO, so it’s recommended to use keywords within them. Here, we’ve changed the file name for a post on inspiring forest images:
之后,键入您要使用的文件名。 图像文件名对WordPress SEO的影响很小,因此建议在其中使用关键字。 在这里,我们更改了有关启发性森林图像的帖子的文件名:
You cannot rename or move a folder in Media Library Folders. However, it’s possible to create a new folder, move all the images into it, then delete the old folder.
您不能在“媒体库文件夹”中重命名或移动文件夹。 但是,可以创建一个新文件夹,将所有图像移入其中,然后删除旧文件夹。
To delete a folder, right click on it, and then click ‘Delete this folder?’ button. Here, we’ve moved the forest images into a new folder called Woodlands, and we’re deleting the Forests folder:
要删除文件夹,请右键单击该文件夹,然后单击“删除此文件夹?”。 按钮。 在这里,我们将森林图像移到了一个名为Woodlands的新文件夹中,并且正在删除Forests文件夹:
You’ll then see a message prompting you to confirm. Click ‘OK’ to continue and the folder will be deleted. You’ll no longer see it in the list:
然后,您会看到一条消息,提示您进行确认。 单击“确定”继续,文件夹将被删除。 您将不再在列表中看到它:
Tip: You may see the message ‘This folder is not empty and could not be deleted’ even though the folder looks empty. Simply click the ‘Sync’ button. WordPress may have created additional versions of your images that need deleting. After syncing, you’ll be able to review and delete those images.
提示:即使文件夹看起来为空,您也可能会看到消息“此文件夹不为空,无法删除”。 只需单击“同步”按钮。 WordPress可能已经创建了需要删除的图像的其他版本 。 同步后,您将可以查看和删除这些图像。
We hope this article helped you learn how to organize WordPress files in media library folders. You might also want to check out our articles on fixing common image issues in WordPress and other must have WordPress plugins for business websites.
我们希望本文能帮助您学习如何组织媒体库文件夹中的WordPress文件。 您可能还需要查看有关修复WordPress中常见图像问题的文章,并且其他文章必须具有用于商业网站的WordPress插件 。
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在Twitter和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-organize-wordpress-files-in-media-library-folders/
最后
以上就是懦弱月光为你收集整理的如何在媒体库文件夹中组织WordPress文件的全部内容,希望文章能够帮你解决如何在媒体库文件夹中组织WordPress文件所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复