我有一个客户,我从头开始完成了一个 WordPress 主题的设计,该项目是一个互联网电视网站,虽然我找不到一个满足基本需求的像样的视频库插件,但我设计了该网站,并在研究后找到了 mpora,其中有我想要完成的确切方法,有人可以向我指出一个插件的方向或一种工作原理相同的主题方法...
http://video.mpora.com/snowboarding/
如果我可以将视频嵌入到可以分类的普通帖子中,并且他可以像普通博客一样添加附加信息,那就太好了帖子和主页上的缩略图显示在图库中,单击后将显示完整帖子。另外还可以将所有其他博客文章放在 /blog 下,
谢谢。
I have a client that i have completed a design from scratch and wordpress theme, the project is an internet TV website, although im falling short on finding a Decent video gallery plugin that meets basic needs, I designed the site and after researching found mpora, which had the exact method i was trying to accomplish, can someone point me in the direction of a plugin or a method of theming that works the same...
http://video.mpora.com/snowboarding/
It would be superb if i could embed a video into a normal post that can be categorized and he can add additional information like a normal blog post and on the homepage have the thumbnail displayed in a gallery, when clicked takes to the full post. plus be able to have all other blog posts under a /blog
Thanks.
发布评论
评论(1)
您知道这并不难做到...
在您的模板的functions.php 文件中只需添加即可。
这将使您能够创建一个 single-{CATID-NUMBER}.php 文件,即
single-5.php
5 是名为“VIDEO”的类别,其 ID 为 5,但请确保更改此设置以匹配您的安装...
在此单打页面中,您可以使用自定义字段,将视频嵌入代码拉到该页面上...
然后再次在您的functions.php中使用
,您可以启用帖子缩略图,只需使用它们和主页上的自定义wp_query即可使用帖子缩略图作为链接从该类别中提取视频列表?
使用 WordPress 几乎总有办法:)
!!!更新!!! - 在下面回答您的评论..
single-5.php 文件是在您的主题文件夹中创建的,然后 WordPress 将解释此文件并仅在类别 5(视频)的单个帖子正在运行时显示此页面查看,这只是为了让您可以拥有视频样式的页面,即看起来像 this ,这样你就可以设计你的常规帖子与视频页面的帖子不同...
要实现此目的,您将代码的第一部分添加到主题文件夹中的函数文件中。然后要使用内置的帖子缩略图,
再次将该行添加到您的函数文件中,
然后在编写帖子或添加新视频时,您将像平常一样编写帖子,
然后...
在您选择类别的右侧,您应该会看到一个新面板,名为特色图像,它是由添加 add_theme_support( '后缩略图');添加到您的函数文件中。
点击“设置特色图像”链接,
您的媒体浏览器将会出现,可以上传图像用作缩略图,也可以使用“FROM URL” >”在顶部,然后粘贴来自 youtube 的缩略图的链接,在图像属性详细信息部分,底部会有一个小链接,
“用作特色图像”,单击此按钮会将图像添加为特色图像...
然后按照上面的其余信息操作:),使用模板文件中的 has_post_thumbnail() 来显示特色图片...
马蒂...
You know this isnt that hard to do...
in your functions.php file for your template simply add.
this will enable you to create a single-{CATID-NUMBER}.php file, ie
single-5.php
5 is the category called 'VIDEO', which has an ID of 5, but make sure you change this to match your install...
within this singles page you can use custom fields, to pull your video embed code onto that page...
then using
within your functions.php again, you can enable post thumbnails, simply use those and a custom wp_query on your home page to pull a list of videos from that category using the post thumbnails as the link?
with wordpress theres nearly always a way :)
!!!UPDATE !!! - To answer your comment below..
The single-5.php file is created inside your theme folder, then wordpress will interpret this file and shows this page only when a single post from the category 5 (Video) is being viewed, this is only so you can have a Video styled page, ie so it looks like this, and so you can style your regular posts differently from that of your video pages...
To achive this you add the first section of code to your functions file also in your theme folder. then to use the in-built post thumbnail, add the line
to your functions file once again,
then while writing a post, or adding a new video, you would write a post as notmal,
Then...
On the right hand side under where you pick the category you should see a new panel, called FEATURED IMAGE, this is created by adding add_theme_support( 'post-thumbnails' ); to your functions file..
click on the "set featured image" link,
Your media browser will appear, either upload an image to use as the thumbnail or use the "FROM URL" up top, and paste in the link to the thumbnail ie from youtube, and in the image property details section, there will be a small link at the bottom,
"USE AS FEATURED IMAGE", click this and that will add the image as the featured image...
then follow the rest of the info above :) using the has_post_thumbnail() within your template file to show the featured images...
Marty...