Incorporate video at homepage
-
Hi!
I was trying to post some videos at my blog homepage but after I try to do it, i can´t see my video in my homepage blog. The only thing I can see is the title of my post.
How can I post videos at the homepage when using Montezuma?
Thanks you guys!
Rodrigo
-
When posting a question, please post a link to your site; it make it easier to diagnose problems.
By default, the excerpts on the blog page will not show videos. In fact, you will not see any formatting, like bold text or italics on your excerpts as well. That’s a WordPress feature and not a Montezuma feature. By default WordPress will strip out all HTML tags from the excerpt. The reason is that WordPress takes the first 55 words in the post when creating the excerpt, and if a closing tag happens to appear after the 55th word, then that could potentially screw up the appearance of the page.
There are a couple of different things you can do (read both options fully first):
- Display the Entire Contents of all Posts in the Blog
To do this, you will have to edit the sub template which displays the posts on the blog page. Go to Montezuma Options > Sub Templates > postformat.php. This is the virtual sub template which controls the appearance of the post excepts on the blog page. This line retrieves and displays the blog excerpt. Note that the default is 55 words:<?php bfa_excerpt( 55, ' ...' ); ?>You can change that line to this:
<?php the_content('Read more...'); ?>What this will do is display the entire post on the blog page, including any embedded videos. All of the formatting will also be retained. If you don’t want the entire post to display, you can manually insert the more tag like this somewhere in the post (make sure you are using the Text editor and not the Visual editor):
blah blah blah <!--more--> blah blah blah - Create a Video Post Sub Template
Probably the better option is to create a sub template for a video post format. That way, you don’t have to display the entire post contents of all of your blog entries, just the ones which have a video. For example, if you go edit your post which has the embedded video, you should see a box on the right that’s labeled Format. This box allows you to set the post format for this post. The default is Standard, but there are other formats like Aside, Gallery, Image, and Video. Right now, there is no difference when you pick a particular post format, they all use the postformat.php virtual subtemplate to display the post on the blog page. Montezuma, though, allows you to create different templates depending upon what type of post you are creating.Go to Montezuma Options > Sub Templates. You can read the section under Only the “Standard” Post Format sub template is included, you can create the 9 special ones for more information, but basically, what we’ll do is make a copy of the postformat.php for your video posts:
- Click + Add sub template.
- For template name, enter postformat-video.
- In the dropdown labeled Make new template a copy of:, select postformat.
- Click the ADD Sub Template button.
- You’ll get a message saying that the sub template was successfully added.
- Click on the new postformat-video.php virtual template on the left, and you’ll see that it’s a copy of postformat.php. Change this line:
<?php bfa_excerpt( 55, ' ...' ); ?>to this:
<?php the_content('Read more...'); ?>Note that this is the same change as above, but since you are creating a special template for your video posts, this will not affect any posts which are not set to Video.
- Save the sub template and go edit your video posts, setting the Format to Video. The video post will now appear on the blog page in its entirety, including the video clip.
Hi CrouchingBruin!
Thank you very much. I did the changes and it works fine. The only thing is Youtube´s ads shows up under the video. But don´t mind. Ads for my Adsense account.
I´ll reply this tip on the blogs I manage.
Thanks again.
Rodrigo
- Display the Entire Contents of all Posts in the Blog
The topic ‘Incorporate video at homepage’ is closed to new replies.
