How To Align YouTube Videos In WordPress?

How To Align YouTube Videos In WordPress?

Here lately, I am seeing a lot of bloggers publishing videos on their blogs. Whether they are self-created or relevant ones from YouTube, videos are always great to relay your insights effectively and instantly grab your audience’s attention.

One thing that I notice is that many do not usually align the videos in the center. I don’t really know the reasons why they leave it as it is. The reasons could be because they don’t know how to center align the videos or because they think the default alignment is good enough. Now, I am not trying to be a perfectionist here but the center aligning of a video looks much better and professional than the default alignment (i.e. left alignment). Scroll down to check out the center aligned video below…What do y’all think?

Normally you can easily align images that are uploaded in the Media Library, as WordPress has a built-in feature that asks you whether you want the image in the left, center or right before posting it. However, if the image is not uploaded in the Media Library and the image source is from a different site, you need to use Div align attribute.

So what you basically do is just wrap the source codes for your image with the div align tag as shown below. (Note that you have to be in the HTML tab in WordPress not the Visual tab when dealing with codes.) This code is to align images to the center of your post. You replace center with left or right depending on where you want to align the image.

<div align=”center”>The Image/YouTube video Source code</div>

Similarly if you want to align the embedded YouTube video in your blog, you use the same div align tag as you would for the image.

For instance, this is the code from the YouTube video I created earlier today which is aligned to the center of this blog post further down below:

<div align=”center”><object width=”425″ height=”349″><param name=”movie” value=”http://www.youtube.com/v/K5sse1Mp4es?fs=1&amp;hl=en_US&amp;rel=0″ /><param name=”allowFullScreen” value=”true” /><param name=”allowscriptaccess” value=”always” /><embed type=”application/x-shockwave-flash” width=”425″ height=”349″ src=”http://www.youtube.com/v/K5sse1Mp4es?fs=1&amp;hl=en_US&amp;rel=0″ allowscriptaccess=”always” allowfullscreen=”true”></embed></object></div>

The bold sections are the div align codes and the rest, non-bold codes, are the video source codes. And replace the word center with left or right wherever you want the video.

This piece of HTML tag is pretty handy to make your site look a little more professional.

Still confused about it? Here is the video that I was talking about earlier:

Please feel free to comment down below and share your insights. Plus, if you like this article Tweet it, share it in Facebook or your favorite social media outlets.

Here’s to your successful blogging endeavor!

-Adam Paudyal.

Before you go...

  • Subscribe to our Newsletter to get timely tips and advice for your successful online endeavor!
  • Subscribe to the RSS feed to read the blog posts in the feed reader!
  • Follow me on Twitter
  • Connect with me in Facebook

8 Responses to How To Align YouTube Videos In WordPress?

  1. Adrienne says:

    Hey Adam,

    Great tip. I use to align my videos in the center by just clicking on “center” but I guess with the updated versions of WP, that stopped working. I would go into the code and type in , etc. before the HTML coding from my YouTube video but that never worked. Now I know why.

    SO excuse all of us ignorant people who don’t know how to do this until someone like you comes along and fills us in. You’re the man my friend. Thanks for that because I sure like mine centered.

    Have a great day Adam and a really fun weekend.

    Adrienne
    Adrienne recently posted..The Secret to Making People Read Your PostMy Profile

  2. Hi Adam:

    Thanks for the info. But I never had a problem with a You tube video. If I did have a problem I know who to turn to.

    Your post has explained it well, and it sounds easy to do.

    Enjoy your week end

    Fran A
    Fran Aslam From Onlinewriter recently posted..101 Blog TopicsMy Profile

  3. Ashvini says:

    Yep div align=center is a nice way to center the videos. Thanks for your post.
    Ashvini
    Ashvini recently posted..Convert your hobby to business – Part 3- ChallengesMy Profile

  4. Ive used this code.?phpprint swf sites default files frontpage.swf array params array width 960 height 700 align center ?.to create a custom frontpage with frontpage module. I cant seem to align it in the center of the browser..Ive look to the source code of the page and it is writing.param name align value center .Besides this in Swf Tools default settings for embedding ive choosen align centered..Ive clear the cache several times too..Is it the syntax that is wrong?

  5. Justine says:

    This is what I was just looking for! Finally, I found a great article that I can relate to! My problem with aligning my videos in Word press is really freaking me out before. But now that I found this, what a great help for me. With a bonus, a detailed step-by-step process on doing it. What more can I ask for! Thanks a lot for this good share!
    Justine recently posted..Astral Projection Classes- What to Expect and Do they Really HelpMy Profile

  6. Hi Adam, I know html but I imagine that most bloggers don’t. Between WP updates, theme changes, and all those essential plug ins, it can be difficult to figure out where you went wrong! There are some things (Com Luv) that I’ve struggled with for hours and they still don’t work. I wouldn’t be surprised if people just give up trying to fix things and figure it’s good enough.
    Jennifer Barry recently posted..5 Language Learning Excuses and How to Get Past ThemMy Profile

  7. Hi Adam Paudyal

    Your article on the topic How To Align YouTube Videos In WordPress? includes the information that i was looking for.
    Your post great and you managed to keep it simple and understandable.
    Your post helps me to understand How To Align YouTube Videos In WordPress? really is, and i will surely recommend it to other people.

    Thanks and keep up the good work.

  8. [...] that can capture your computer screen actions and turn them into a movie such as the one in How To Align YouTube Videos In WordPress? by Adam.  This is an excellent tool for creating learning media, on line manuals, and [...]

Leave a reply

CommentLuv badge