<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WP Engineer &#187; CSS</title>
	<atom:link href="http://wpengineer.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Sun, 22 Jan 2012 13:32:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Extend the TwentyEleven Navigation with your Social Icons</title>
		<link>http://wpengineer.com/2310/extend-the-twentyeleven-navigation-with-your-social-icons/</link>
		<comments>http://wpengineer.com/2310/extend-the-twentyeleven-navigation-with-your-social-icons/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 07:32:55 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Advent Calendar]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2310</guid>
		<description><![CDATA[In this little tutorial we show how to add in the navigation of the TwentyEleven Theme our RSS Feed, a link with icons to our Twitter page and to our Facebook profile. Without writing a single line of PHP code. You are able to accomplish this with the WordPress Menu. First we go in the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-2313" title="TwentyEleven Screenshot" src="http://wpengineer.com/wp-content/uploads/twenty-eleven-screenshot.jpg" alt="TwentyEleven Screenshot" width="692" height="348" /></p>
<p>In this little tutorial we show how to add in the navigation of the TwentyEleven Theme our RSS Feed, a link with icons to our Twitter page and to our Facebook profile. Without writing a single line of PHP code. You are able to accomplish this with the WordPress Menu.</p>
<p>First we go in the backend to Design-&gt; Menu and activate the CSS Classes. Therefore we click on "Screen Options" on the very top right corner. And unter "Show advanced menu properties" you check the box for "CSS Classes" and close the Screen Options.</p>
<p><img class="alignnone size-full wp-image-2311" title="WordPress menu screen options" src="http://wpengineer.com/wp-content/uploads/screen-options.jpg" alt="WordPress menu screen options" width="574" height="136" /></p>
<p>After that we use the "Custom Links" to create the menu entries. We add the addresses to our RSS Feed, Facebook and Twitter and add them to the menu. There we assign the 3 menu entries to the CSS Classes. RSS Feed has the class <code>rss</code>, Twitter the class <code>twitter</code> and Facebook <code>facebook</code>. Don't forget to save.</p>
<p><img class="alignnone size-full wp-image-2314" title="WordPress Menu" src="http://wpengineer.com/wp-content/uploads/wordpress-menu.jpg" alt="WordPress Menu" width="423" height="400" /></p>
<p>I prepared a sprite, which you can download with a right mouse click-&gt;Save Image As… . You have to save this sprite into the folder <code>twentyeleven/images/</code>.</p>
<p><img class="alignnone size-full wp-image-2312" title="Social Sprite" src="http://wpengineer.com/wp-content/uploads/social-sprite.png" alt="Social Sprite" width="80" height="290" /></p>
<p>Then we open the file TwentyEleven style.css with a text editor and add at the end of the Menu block <code>#access</code> our additional CSS. We do not have much to add. We let our 3 list items float to the right, push the text out of view and position the graphic. Only for the hover, focus and active states, we must define a little tricky CSS rule in order to circumvent the background gradients of TwentyEleven.</p>
<pre>
#access .twitter, #access .rss, #access .facebook {
	float: right;
}
#access .twitter a, #access .rss a, #access .facebook a {
	background: transparent url(images/social-sprite.png) 0 0 no-repeat;
	padding: 0;
	text-indent: -9999px;
	width: 70px;
}
#access .rss a { background-position: 0 0; }
#access .facebook a { background-position: 0 -96px; }
#access .twitter a { background-position: 0 -48px; }
#access .rss a:hover, #access .rss a:focus, #access .rss a:active {
	background: transparent url(images/social-sprite.png) 0 -144px no-repeat;
}
#access .twitter a:hover, #access .twitter a:focus, #access .twitter a:active {
	background: transparent url(images/social-sprite.png) 0 -192px no-repeat;
}
#access .facebook a:hover, #access .facebook a:focus, #access .facebook a:active {
	background: transparent url(images/social-sprite.png) 0 -240px no-repeat;
}
</pre>
<p>This is just an example to experiment. Add your Google+ profile and expand this example with cool CSS tricks!<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2310/extend-the-twentyeleven-navigation-with-your-social-icons/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Use WordPress Custom Post Type In CSS-Class for Styling</title>
		<link>http://wpengineer.com/2180/use-wordpress-custom-post-type-in-css-class-for-styling/</link>
		<comments>http://wpengineer.com/2180/use-wordpress-custom-post-type-in-css-class-for-styling/#comments</comments>
		<pubDate>Wed, 24 Aug 2011 09:03:06 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2180</guid>
		<description><![CDATA[Today I would like to show you, how to assign CSS classes to custom post types for styling your website. Basically we just extend the function body_class() of WordPress with our own post types, so that we can address them to style our design accordingly. The same I had already explained in detail in another [...]]]></description>
			<content:encoded><![CDATA[<p>Today I would like to show you, how to assign CSS classes to custom post types for styling your website.<br />
<span id="more-2180"></span><br />
Basically we just extend the function <a href="http://codex.wordpress.org/Template_Tags/body_class"><code>body_class()</code></a> of WordPress with our own post types, so that we can address them to style our design accordingly.</p>
<p>The same I had already explained in detail in <a href="http://wpengineer.com/2043/individual-design-for-any-page/">another post</a> where the title of a post has been incorporated into this function, so there you can find additional information.</p>
<pre>
// Adds classes for custom post types to body_class() and post_class()
function fb_add_body_class( $class ) {
	$post_type = &#039;my_example_post_type&#039;; // the Post Type

	if ( get_query_var(&#039;post_type&#039;) === $post_type ) { // only, if post type is active
		$class&#091;&#093; = $post_type;
		$class&#091;&#093; = &#039;type-&#039; . $post_type;
	}

	return $class;
}
add_filter( &#039;body_class&#039;, &#039;fb_add_body_class&#039; );
</pre>
<p>Alternatively you can extend the function <a href="http://codex.wordpress.org/Function_Reference/post_class"><code>post_class()</code></a> so you won't have the class of the custom post type directly at the body tag. Therefore I use the same function and we just address the hook of the post class.</p>
<pre>
add_filter( &#039;post_class&#039;, &#039;fb_add_body_class&#039; );
</pre>
<p>Both template tags are used in HTML tag, as it shown on the codex pages, we have mentioned above; and here is an example for the post class:</p>
<pre>
&lt;div &lt;?php post_class(&#039;class-name&#039;); ?&gt;&gt;
</pre>
<p>Enjoy testing and using it, if you know any improvements or have any question, please feel free and leave a comment.</p>
<p><strong>Update:</strong> A small example for the custom taxonomie inside this fucntions of WordPress</p>
<pre>
function fb_add_body_class( $class ) {

	if ( ! is_tax() )
		return $class;

	$tax   = get_query_var( &#039;taxonomy&#039; );
	$term  = $tax . &#039;-&#039; . get_query_var( &#039;term&#039; );
	$class = array_merge( $classes, array( &#039;taxonomy-archive&#039;, $tax, $term ) );

	return $class;
}
add_filter( &#039;body_class&#039;, &#039;fb_add_body_class&#039; ); // or post_class as hook
</pre>
<p>Use or fork it and have an idea or small solution for your requirements.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2180/use-wordpress-custom-post-type-in-css-class-for-styling/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Move WordPress Admin Bar to the Bottom</title>
		<link>http://wpengineer.com/2190/move-wordpress-admin-bar-to-the-bottom/</link>
		<comments>http://wpengineer.com/2190/move-wordpress-admin-bar-to-the-bottom/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 08:00:29 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[Admin Bar]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[wp3.1]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2190</guid>
		<description><![CDATA[Not everybody likes the WordPress Admin Bar, which exists since WordPress 3.1, at the top of the browser. With just a bit CSS you can change it. The following function provides CSS directly in the footer of backend and frontend. It displays the Admin Bar at the bottom. You can expand the code as you [...]]]></description>
			<content:encoded><![CDATA[<p>Not everybody likes the WordPress Admin Bar, which exists since WordPress 3.1, at the top of the browser. With just a bit CSS you can change it. The following function provides CSS directly in the footer of backend and frontend. It displays the Admin Bar at the bottom.<br />
<span id="more-2190"></span><br />
You can expand the code as you like, for example the implementation with the help of an external CSS stylesheet to get it into the compiler of WordPress. Also you could arrange options for the users. For my needs this little snippet helped, put in a Plugin or in the <code>functions.php</code> of your theme.</p>
<pre>
function fb_move_admin_bar() {
    echo &#039;
    &lt;style type=&quot;text/css&quot;&gt;
    body {
    margin-top: -28px;
    padding-bottom: 28px;
    }
    body.admin-bar #wphead {
       padding-top: 0;
    }
    body.admin-bar #footer {
       padding-bottom: 28px;
    }
    #wpadminbar {
        top: auto !important;
        bottom: 0;
    }
    #wpadminbar .quicklinks .menupop ul {
        bottom: 28px;
    }
    &lt;/style&gt;&#039;;
}
// on backend area
add_action( &#039;admin_head&#039;, &#039;fb_move_admin_bar&#039; );
// on frontend area
add_action( &#039;wp_head&#039;, &#039;fb_move_admin_bar&#039; );
</pre>
<p>As an alternative you could also use <a href="http://wordpress.org/extend/plugins/stick-admin-bar-to-bottom/">this Plugin</a>, thanks Coen!<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2190/move-wordpress-admin-bar-to-the-bottom/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Simple Media Queries Tester</title>
		<link>http://wpengineer.com/2160/simple-media-queries-tester/</link>
		<comments>http://wpengineer.com/2160/simple-media-queries-tester/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 12:08:16 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WPengineer Misc]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2160</guid>
		<description><![CDATA[CSS Media Queries are getting more popular and the adjustment of the size of a website for different clients or the size of the browsers are more necessary. The Media Queries are a solution, which also have its advantages and disadvantages. It was a disadvantage, when using, that I couldn't see all sizes at the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-23.jpg" alt="" title="WordPress-Christmas-2010-23" width="400" height="267" class="aligncenter size-full wp-image-2171" /><br />
<a href="http://css-tricks.com/css-media-queries/">CSS Media Queries</a> are getting more popular and the adjustment of the size of a website for different clients or the size of the browsers are more necessary. The Media Queries are a solution, which also have its advantages and disadvantages. It was a disadvantage, when using, that I couldn't see all sizes at the same time. So why not just a small script, the iframe element. If you like to use it, here is a simple solution or you can use the <a href="http://bueltge.de/test/media-query-tester.php">current script</a> in my "Test-Laboratory".<br />
<span id="more-2160"></span><br />
<a href="http://bueltge.de/test/media-query-tester.php"><img src="http://wpengineer.com/wp-content/uploads/Simple-Media-Queries-Tester-296x300.png" alt="" title="Simple Media Queries Tester" width="296" height="300" class="aligncenter size-medium wp-image-2161" /></a><br />
The solution can be expanded and improved, enjoy.</p>
<p>You can store the following code in a PHP file and can then be used. I played a little with CSS and adapted it; also browser support is probably not very large because I purely use HTML5 and CSS3 and don't use any scripts.</p>
<pre>
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;meta charset=utf-8 /&gt; 

	&lt;title&gt;Simple Media Queries Tester&lt;/title&gt; 

	&lt;meta name=&quot;description&quot; content=&quot;Simple Media Queries Tester&quot; /&gt;
	&lt;meta name=&quot;author&quot; content=&quot;Frank Bueltge - http://bueltge.de&quot; /&gt; 

	&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;
	/*&lt;!&#091;CDATA&#091;*/
		body { background:#fff;font-family:Arial,Helvetica,sans-serif;font-size:100%;margin:20px; }
		a { text-decoration:none; color:#1152c8; }
		fieldset { border:1px solid #ccc; margin:0 0 20px 0; }
		form#mediaqueriestest input { margin:auto; }
		form#mediaqueriestest button { margin:auto;text-shadow:0 1px 1px #000;text-transform:uppercase; }
		form#mediaqueriestest button:hover { background:#1152c8;color:#000;cursor:pointer; }
		form#mediaqueriestest input:active, form#mediaqueriestest input:focus { outline:none;border:1px solid #333;background:#fff;color:#000;-moz-border-radius:20px;-webkit-border-radius:20px;-khtml-border-radius:20px;border-radius:20px; }
		form#mediaqueriestest fieldset, form#mediaqueriestest legend, form#mediaqueriestest input, form#mediaqueriestest button, iframe, footer {
background:#333;color:#fff;padding:7px 25px;border:1px solid #333;-moz-border-radius:20px;-webkit-border-radius:20px;-khtml-border-radius:20px;border-radius:20px; }
		form#mediaqueriestest fieldset, form#mediaqueriestest legend { background:#ccc;color:#000;margin:10px;padding-bottom:25px; }
		form#mediaqueriestest legend { padding:7px 25px;-webkit-box-shadow: 2px 2px 2px #333; }
		iframe { margin:0 auto; border:1px solid #ccc; margin:10px; }
		footer { display:block; color:#333; margin:20px 0 0 0; border:2px solid #ba0100; background:#fff; }
	/*&#093;&#093;&gt;*/
	&lt;/style&gt;

&lt;/head&gt;
&lt;body&gt;
	&lt;header&gt;
		&lt;h1&gt;&lt;a href=&quot;http://bueltge.de/&quot; title=&quot;to the weblog of the author&quot;&gt;Simple Media Queries Tester&lt;/a&gt;&lt;/h1&gt;
	&lt;/header&gt;

	&lt;section&gt;
		&lt;form id=&quot;mediaqueriestest&quot; action=&quot;&lt;?php echo htmlspecialchars( strip_tags($_SERVER&#091;&#039;PHP_SELF&#039;&#093;) ); ?&gt;&quot; method=&quot;get&quot;&gt;
		&lt;fieldset&gt;
		&lt;legend&gt;Test your URL&lt;/legend&gt;
		&lt;label for=&quot;testurl&quot;&gt;Test URL&lt;/label&gt;
			&lt;input type=&quot;text&quot; name=&quot;testurl&quot; id=&quot;testurl&quot; placeholder=&quot;Input your test url here&quot; size=&quot;70&quot;&gt;
			&lt;button type=&quot;submit&quot;&gt;Test it!&lt;/button&gt;
		&lt;/fieldset&gt;
		&lt;/form&gt;
		&lt;?php
		if ( !empty($_GET&#091;&#039;testurl&#039;&#093;) ) {
			$newURL = htmlspecialchars( strip_tags($_GET&#091;&#039;testurl&#039;&#093;), ENT_QUOTES );
			if (preg_match(&quot;/^(www.)/i&quot;, $newURL) )
				$iframeurl = &#039;http://&#039;.$newURL;
			elseif (preg_match(&quot;/^(http:\/\/)/i&quot;, $newURL))
				$iframeurl = $newURL;
			else
				$iframeurl = &#039;http://www.&#039; . $newURL;

			echo &#039;&lt;iframe name=&quot;fullsize&quot; id=&quot;fullsize&quot; width=&quot;960&quot; height=&quot;450&quot; seamless=&quot;seamless&quot; src=&quot;&#039; . $iframeurl . &#039;&quot;&gt;&lt;/iframe&gt;&#039;;
			echo &#039;&lt;iframe name=&quot;netbook&quot; id=&quot;netbook&quot; width=&quot;650&quot; height=&quot;450&quot; seamless=&quot;seamless&quot; src=&quot;&#039; . $iframeurl . &#039;&quot;&gt;&lt;/iframe&gt;&#039;;
			echo &#039;&lt;iframe name=&quot;mobile&quot; id=&quot;meinframe&quot; width=&quot;450&quot; height=&quot;450&quot; seamless=&quot;seamless&quot; src=&quot;&#039; . $iframeurl . &#039;&quot;&gt;&lt;/iframe&gt;&#039;;
		} else {
			echo &quot;no page loads - enter address&quot;;
		}
		?&gt;
	&lt;/section&gt;

	&lt;footer&gt;
		&lt;p&gt;
		&copy; 2010 &lt;a href=&quot;http://bueltge.de/&quot;&gt;bueltge.de&lt;/a&gt; &middot; &lt;a href=&quot;http://bueltge.de/impressum/&quot;&gt;Impress&lt;/a&gt;
		&lt;/p&gt;
	&lt;/footer&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2160/simple-media-queries-tester/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple Autoresize for WordPress Background Image Function</title>
		<link>http://wpengineer.com/2105/simple-autoresize-for-wordpress-background-image-function/</link>
		<comments>http://wpengineer.com/2105/simple-autoresize-for-wordpress-background-image-function/#comments</comments>
		<pubDate>Sun, 19 Dec 2010 12:41:27 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WPengineer Misc]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2105</guid>
		<description><![CDATA[In WordPress 3.0 you have the possibility to easily upload and use a background image. The image is positioned via CSS in the background. Thus it is not quite simple to have the possibility of auto resize and the background adapts to the size of the browser. There are some nice possibilities for this request, [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-19.jpg" alt="" title="WordPress-Christmas-2010-19" width="400" height="267" class="aligncenter size-full wp-image-2146" /><br />
In WordPress 3.0 you have the possibility to easily upload and use a <a href="http://wpengineer.com/1964/wordpress-3-0-custom-background-support/">background image</a>. The image is positioned via CSS in the background. Thus it is not quite simple to have the possibility of auto resize and the background adapts to the size of the browser. There are some nice possibilities for this request, I will briefly highlight a very simple way of using CSS, since then the function of WordPress will not be effected.</p>
<p><span id="more-2105"></span><br />
The following syntax must be integrated within the stylesheet. You can also create a <a href="http://wpengineer.com/2045/understand-wordpress-child-theme/">Childtheme</a> when the original theme should not be changed. The values have to be provided with <code>!important</code> since otherwise the values of WordPress will be used. So that the background is always adjusted to the size of the browser - but beware: this is not always the best solution because the images are going to change from the actual size. So it can look very distorting. The sample screenshot is as little sensitive as the clouds tolerate this and still provide a nice background picture - in contrast to the standard in which the image in the preview would be tiled, and for other images may look very ugly.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/autoresize-settings-300x190.png" alt="" title="autoresize-settings" width="300" height="190" class="aligncenter size-medium wp-image-2107" /></p>
<pre>
body {
	background-repeat:no-repeat !important;
	background-position:center center !important;
	background-attachment:fixed !important;
	-o-background-size: 100% 100%, auto !important;
	-moz-background-size: 100% 100%, auto !important;
	-webkit-background-size: 100% 100%, auto !important;
	background-size: 100% 100%, auto !important;
}
</pre>
<p>This CSS is not usable in all browsers, <a href="http://caniuse.com/?utm_content=backtype-tweetcount&#038;utm_medium=bt.io-twitter&#038;utm_source=twitter.com#search=background-size">see overview </a>, therefore it provides only in newer browsers the expected effect. The Internet Explorer has it difficulties with it.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/autoresize-example-300x153.png" alt="" title="autoresize-example" width="300" height="153" class="aligncenter size-medium wp-image-2106" /></p>
<pre>
function fb_header_callback() {

  $background = get_background_image();
  if ( ! $background )
    return;

  if ( $background ) {
    $image = &quot; background-image: url(&#039;$background&#039;);&quot;;

    $style  = &#039;background-repeat:no-repeat;&#039;;
    $style .= &#039;background-position:center center;&#039;;
    $style .= &#039;background-attachment:fixed;&#039;;
    $style .= &#039;-o-background-size: 100% 100%, auto;&#039;;
    $style .= &#039;-moz-background-size: 100% 100%, auto;&#039;;
    $style .= &#039;-webkit-background-size: 100% 100%, auto;&#039;;
    $style .= &#039;background-size: 100% 100%, auto;&#039;;

    $style .= $image . $style;
  }
?&gt;
&lt;style type=&quot;text/css&quot;&gt;
body { &lt;?php echo trim( $style ); ?&gt; }
&lt;/style&gt;
&lt;?php
}
</pre>
<p>This function must be given to the function as a callback, of course it can be adjusted. In the <code>functions.php</code> of the theme it should work if the background image functionality already exists, the function <code>add_custom_background()</code>. This needs to be expanded in the first parameter with the new function and now the default callback of WordPress will no longer be called.</p>
<pre>
	// This theme allows users to set a custom background
	add_custom_background( &#039;fb_header_callback&#039; );
</pre>
<p>The style will then output via hook <code>wp_head</code> directly in <code>head</code>, rather ugly - I think, and therefore you should format it in the style sheet, since it is static anyway and can not be adjusted by the user. Equally important is, that the hook is also present in the Theme, which is also important for other Plugins or features.</p>
<h4>Use values from the backend</h4>
<p>The last little tip for your own adjustments. I want to show you how to get the values from the backend and use them.<br />
The background color of the wallpaper options will be given back with the following function:</p>
<pre>$color = get_background_color();</pre>
<p>The image gets via:</p>
<pre>$background = get_background_image();</pre>
<p>And query individual settings for the style via <code>get_theme_mod($name);</code>:<br />
The following little snippet gives the set values back to the Theme.</p>
<pre>
$mods = get_theme_mods();
var_dump($mods);
</pre>
<p>For the default Theme Twenty Ten it could look like this:</p>
<pre>
string &#039;Twenty Ten&#039; (length=10)

array
  &#039;background_image&#039; =&gt; string &#039;http://localhost/wpbeta/wp-content/uploads/2010/12/apple-touch-icon.png&#039; (length=71)
  &#039;background_image_thumb&#039; =&gt; string &#039;http://localhost/wpbeta/wp-content/uploads/2010/12/apple-touch-icon.png&#039; (length=71)
  &#039;background_repeat&#039; =&gt; string &#039;no-repeat&#039; (length=9)
  &#039;background_position_x&#039; =&gt; string &#039;center&#039; (length=6)
  &#039;background_attachment&#039; =&gt; string &#039;scroll&#039; (length=6)
  &#039;background_color&#039; =&gt; string &#039;&#039; (length=0)
</pre>
<p>Based on these values in the array you can, for example, get the value <code>background_repeat</code>,</p>
<pre>$repeat = get_theme_mod( &#039;background_repeat&#039; );</pre>
<p>which gives in this example <code>no-repeat</code> back.</p>
<p>The other values can be treated similarly, a lot of possibilities and opportunities.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2105/simple-autoresize-for-wordpress-background-image-function/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create Your Own WordPress Login Design</title>
		<link>http://wpengineer.com/483/create-your-own-wordpress-login-design/</link>
		<comments>http://wpengineer.com/483/create-your-own-wordpress-login-design/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 13:00:02 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[wp2.7]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=483</guid>
		<description><![CDATA[WordPress 2.7 has been released these days and comes with some updates to the backend design. I think most of you already know that there is a new login-section. The design is now equal to the new backend's and the team did only little changes. From my point of view this is very important to [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress 2.7 has been released these days and comes with some updates to the backend design. I think most of you already know that there is a new login-section. The design is now equal to the new backend's and the team did only little changes.<br />
From my point of view this is very important to an all-inclusive-package, like a theme &#8211; or a corporate design.<br />
The CSS changed a bit and if anybody wants to customize the login-section, I will show how to achieve it. The CSS is also included as a good starting point for your own custom design.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/wp27-login.png" alt="" title="wp27-login" width="448" height="461" class="aligncenter size-full wp-image-484" /><br />
<span id="more-483"></span></p>
<h3>Loading the Stylesheet</h3>
<p>I have to use a simple function, which I put in <code>functions.php</code> of the current theme and integrate it via hook <code>login_head</code> into the login-head to load the css for the login-section. This will make the custom css being referenced only by one specific theme and if I switch to a different, a different css will also be loaded.</p>
<pre lang="php">
// custom login for theme
// folder themes/theme_name/custom-login/
function fb_custom_login() {
	echo &#039;&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;&#039; . get_bloginfo(&#039;template_directory&#039;) . &#039;/custom-login/custom-login.css&quot; /&gt;&#039;;
}

add_action(&#039;login_head&#039;, &#039;fb_custom_login&#039;);
</pre>
<p>The stylesheet comes with the name <code>custom-login.css</code> and is located in <code>/custom-login</code> in the folder of the theme.</p>
<h3>The Stylesheet</h3>
<p>Like I already said, here is tiny example, which includes classes and id's of the login-section, so you can customize it very easily.</p>
<pre lang="css">
html {
background-color: #fff;
}

#login form {
padding-top: 100px;
}
#login form .submit input {
border-color: #bcb38f !important;
color: #777 !important;
}
#login form .submit input:hover {
border-color: #bcb38f !important;
color: #bcb38f !important;
}
#login h1 {
display: none;
}
.login #nav a {
color: #777 !important;
}
.login #nav a:hover {
color: #bcb38f !important;
}

#wphead img, #wphead h1 {
display: none;
}
#wphead {
height: 100px;
}
#wphead-info {
padding-top: 27px;
}

#footer {
display: none;
}
#footer_custom {
clear: both;
text-align: center;
width: 500px;
margin: auto;
height: 100px;
}
#footer_custom .docs {
padding-top: 0px;
line-height: 100%;
}
#footer_image {
border:none;
}
</pre>
<p>The example above is just one way to customize the style. As usual there are unlimited possibilities with css and the art of it. A recommendational note from me, is to use the <a href="http://getfirebug.com/">Firebug</a> extension, which is really helpful when customizing css live. I can't mention this enough.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/483/create-your-own-wordpress-login-design/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

