background

Fancy-up your videos on your blog/website by applying an image frame.

Use Photoshop or PaintShop Pro and create a 300(w) x 230(h) rectangle and design it to taste. Next save the image as videoframe.png and upload it to your "images" directory.

Add the following code to your custom.css file:

1
2
3
4
5
6
7
8
9
/* Video Frame */
.vidframe {
display: block;
width:300;
height: 230px;
text-align: center;
background: url(images/videoframe.png) no-repeat;
padding: 32px 0 0 0;
}

Next use the following "wrap" script in your page, post or sidebar widget:

1
<span class="vidframe">all your video embed codes here</span>

Make sure you change your video's dimensions to 250(w) x 175(h) in the embed code.

Below is an example of the finished product:


 
Go to http://www.happyhomemakercindy.com for a live demo. (right sidebar halfway down)

There are a bunch of jQuery plugins and standard HTML/CSS solutions out there for creating a full screen, or full page background image that will stretch the image to the full width of the browser window. So basically no matter what size the screen is, it will resize the image accordingly. Here are a few that I found while searching:

There are numerous variations for creating the full screen background image, depending on your needs. For example, you can have just a single image, a series of images that rotate, and also you could have content above the image or not. I was working on a website for a client and there was a need to have a series of full screen background images on the home page that rotate and have some content above the image.

I ended up going with bgStretcher, but now I had to make it work in Thesis.

When we talk about jQuery Plugins we aren’t talking about traditional WordPress type plugins. jQuery plugins need to get integrated into the site by adding the necessary code in the right places and referencing the required plugin file.

How to Add a Full Screen Background Image in Thesis

It doesn’t matter which method you use from the list above, and you may even find a different one you prefer, but the concept is the same. In fact, this is a great lesson about Thesis hooks and how to add pretty much any custom functionality or content. Once you understand the concept, you can integrate almost anything you want.

So, let’s take a look at this. We’re going to integrate this jQuery plugin to display a full page background image in Thesis.

Step 1: Download the script

You can visit the bgStretcher page to download the file you need. Specifically, you want the file called bgstretcher.js. Upload this file to a new folder inside your custom folder called “js”. So it will look like this: /wp-content/themes/thesis_x/custom/js. The file needs to be inside the ‘js’ folder.

Step 2: Add the Scripts

Add this to your custom_functions.php file:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function fullbg() {
if (is_front_page()) {
?>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script><script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/custom/js/bgstretcher.js"></script>
<script type="text/javascript">// <![CDATA[
	$(document).ready(function(){
        //  Initialize Backgound Stretcher
		$(document).bgStretcher({
			images: ['<?php bloginfo('template_directory'); ?>/custom/images/sample-1.jpg', '<?php bloginfo('template_directory'); ?>/custom/images/sample-2.jpg', '<?php bloginfo('template_directory'); ?>/custom/images/sample-3.jpg'],
			imageWidth: 1024, imageHeight: 768
		});
	});
// ]]></script>

add_action('thesis_hook_after_html','fullbg');

Here’s what’s happening with this:

  1. I’m using a WordPress conditional tag so that this only appears on the home page. You can either remove this, or modify it so that it shows up where you want.
  2. We’re loading the jQuery library (*** IMPORTANT – If you already have jQuery being loaded, there is no need to do it again.)
  3. I’m inserting this code toward the bottom of of the site by using the thesis_hook_after_html hook.
  4. We’re referencing the bgstretcher.js file. (If you’re using a different plugin, the concept will be the same.)
  5. We’re defining the path and filenames of the images. You can change the filenames to the actual filenames of your images.
  6. We’re applying some options (imageWidth:1024, imageHeight:768). You should check the instructions page for this plugin for additional options. In my case, I also added these options because I wanted a delay between each slide and also a transition speed: nextSlideDelay: 10000, slideShowSpeed: 1000,

Step 3: Upload Your Images

You will need to upload your images that are referenced in the above script to the images folder inside your custom folder.

Step 4: Add the CSS

You’re going to need to reference the css file supplied with this plugin. It’s called bgstretcher.css. You can either include this as a separate css file, which you will need reference in the head section of the site, or you can paste the contents into the custom.css file.

That should do it as far as adding the full screen background images

This is all you need to do in order to get the full page background images working. Now, if you want to add text above the image, you will just need to add this inside the custom.css file to the css selector that contains the content you want to appear above the image:

1
2
position: relative;
z-index: 2;
1
2
3
4
.custom .format_text {
position: relative;
z-index: 2;
}

Hopefully this all makes sense for you. If you have questions or something to add, feel free to leave a comment below.

source:  Thesis-Blog.com

Categories

Impact
Search & Win

Link To Me

If you find anything useful, please