Change fullscreen background images per post/page in wordpress? - Wordpress Solution
[Solved] - Change fullscreen background images per post/page in wordpress? - Wordpress Solution |
---|
Try following codes |
I have been trying to implement the following tutorial in my wordpress install:
http://wpshout.com/wordpress-custom-post-backgrounds/
a successful install should yield the following results:
http://www.nometet.com/reviews/singularity/
where the background is changed relative to the post/page.
I cannot get it to work and was wondering if someone could help or if there's is someone out there who has an even better alternative of doing this technique. The timthumb resizes the image but based on what? Does it detect the users browser resolution?
Also with the inclusion of the new custom background feature in wordpress 3 if I have a default background installed will the above method over ride the default bg?
Solution - 1First, you need to download [[LINK href="http://code.google.com/p/timthumb/"]]TimThumb [[/LINK]], and put it into your theme folder. We use it to resize picture. Add the following code to functions.php: When you create a new post, add custom field "background" with URL is the URL of the background image. You can use WP image uploader to upload background, and grap its URL. You can paste direct URL (with http://) or relative URL as well. Change "w" (width) parameter of timthumb to fit your requirement (in this line):
Solution - 2The PHP code that Rilwis and Oleg gave you is great, but you'll need to use Javascript to resize the image to fit the browser window (since PHP is server side and has no way to get the window size). Edit Rilwis' insert_post_bg function like this:
Solution - 3You can use CSS3 attributes to resize background images. Then use a jQuery fix for browsers that dont support CSS3 attributes, i.e. Internet Explorer 8 and below
Solution - 41) enable featured iamge for page and post (paste this code into functions.php) add_theme_support( 'post-thumbnails' ); add_theme_support( 'post-thumbnails', array( 'post' ) ); add_theme_support( 'post-thumbnails', array( 'page' ) ); Solution - 5A way simpler way to do all of this: [[LINK href="http://codecanyon.net/item/custom-backgrounds-for-wordpress/121983?ref=mordauk"]]Custom Backgrounds Plugin from Code Canyon[[/LINK]] |
Date: 2022-10-21 05:19:59 |
Category: Wordpress |