<?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; Theme</title>
	<atom:link href="http://wpengineer.com/tag/theme/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Mon, 21 May 2012 22:48:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WordPress Jeopardy</title>
		<link>http://wpengineer.com/2295/wordpress-jeopardy/</link>
		<comments>http://wpengineer.com/2295/wordpress-jeopardy/#comments</comments>
		<pubDate>Fri, 25 Nov 2011 21:06:36 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2295</guid>
		<description><![CDATA[The idea of a little game in WordPress came at the WordCamp Switzerland in early 2011. For an interactive session at the WordCamp Germany in Cologne in 2011, one of the creators Thomas, thought that it’d be nice to have a game-session. On 24th of September started the first WordPress Jeopardy Game Session. For that, [...]]]></description>
			<content:encoded><![CDATA[<p>The idea of a little game in WordPress came at the <a href="http://wordcamp-switzerland.ch/">WordCamp Switzerland</a> in early 2011. For an interactive session at the <a href="http://wordcamp.de/">WordCamp Germany</a> in Cologne in 2011, one of the creators <a href="https://github.com/DasLlama">Thomas</a>, thought that it’d be nice to have a game-session.</p>
<p>On 24th of September started the first WordPress <a href="http://en.wikipedia.org/wiki/Jeopardy!" title="How is Jeopardy">Jeopardy Game</a> Session. For that, the whole room was divided in two teams to battle each other. The points were counted, but nobody really knows who won.<br />
<span id="more-2295"></span><br />
<a href="http://jeopardy.inpsyde.com/"><img src="http://wpengineer.com/wp-content/uploads/wordpress-jeopardy-300x206.png" alt="" title="wordpress-jeopardy" width="300" height="206" class="aligncenter size-medium wp-image-2296" /></a></p>
<p>The <a href="http://jeopardy.inpsyde.com/">WPJeopardy</a> was made with WordPress features. Every answer is a post with its postmeta as questions and points. First of all, there’s a german game-pad. In future there will be some more different pads for several skills. Also, there will be a download-area with the theme and the playable pads.</p>
<h3>The Background</h3>
<p>First of all, the website is just a simple and clean WordPress instance. There’s a self-made theme. For the game-pad, there’s a customized template, which is very easy. We need a list of the post-categories and the posts, which are in the given category:</p>
<pre>
&lt;?php
$x = 1;
$cat_args = array( &#039;parent&#039; =&gt; 0 );
$categories = get_categories( $cat_args );
foreach ( $categories as $category ) :

	// Display headline of the category here

	$y = 1;
	$post_args = array( &#039;category&#039; =&gt; $category -&gt; term_id );
	$posts = get_posts( $post_args );
	foreach ( $posts as $post ) :
		// Display post answer, question and points here

	endforeach;
endforeach;
?&gt;
</pre>
<p>The rest of it is simple CSS and jQuery with an <code>onClick</code> event and some positioning stuff. Well, in all, it’s not magic. It’s not even hard to understand how <a href="http://jeopardy.inpsyde.com/">Jeopardy</a> works.<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/2295/wordpress-jeopardy/feed/</wfw:commentRss>
		<slash:comments>4</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>WordPress Custom Post Types Get Into The Loop</title>
		<link>http://wpengineer.com/2249/wordpress-custom-post-types-get-into-the-loop/</link>
		<comments>http://wpengineer.com/2249/wordpress-custom-post-types-get-into-the-loop/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 09:23:25 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[custom post type]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2249</guid>
		<description><![CDATA[WordPress started a new era with the Custom Post Types for developers in the WordPress environment. The possibilities are numerous and primarily from the knowledge of the developer dependent. Nevertheless, there are so many tutorials how to use Custom Post Types in WordPress, but that is not enough - at least not in most cases [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress started a new era with the Custom Post Types for developers in the WordPress environment. The possibilities are numerous and primarily from the knowledge of the developer dependent. Nevertheless, there are so many tutorials how to use Custom Post Types in WordPress, but that is not enough - at least not in most cases and therefore are various other steps necessary to make the use of CPT more efficient and smooth.</p>
<p>In this article I would like to briefly explain how to get content of Custom Post Types in the loop of WordPress. This is not a complete guide, but please feel free to add tips, critics, hints in our comment area.</p>
<p><span id="more-2249"></span><br />
<img src="http://wpengineer.com/wp-content/uploads/cpt-example.png" alt="" title="cpt-example" width="328" height="226" class="aligncenter size-full wp-image-2250" /><br />
The screenshot is an example of the use of CPT, hereby were the Plugins <a href="http://wordpress.org/extend/plugins/archive/" title="WordPress Plugin Archive">Archive</a> und <a href="http://wpplugins.com/plugin/281/snippets" title="WordPress Plugin Snippet">Snippet</a> created, they have different tasks and via CPT tailored to the requirements you need.</p>
<p>In the first case, the syntax is shown how to use the query and passes through the type of the CPT via parameters. In a template of the theme it ensures that only the CPT will be read. All other parameters of the query remain untouched.</p>
<pre>
query_posts( &#039;post_type=my_post_type&#039; )
</pre>
<p>Another solution differs essentially only in style and that several CPTs are passed, wich are in an array.</p>
<pre>
global $query_string;
parse_str( $query_string, $args );
$args&#091;&#039;post_type&#039;&#093; = array( &#039;my_post_type&#039;, &#039;my_second_post_type&#039; );
query_posts( $args );
</pre>
<p>To complete the loop of WP and not to limit, the array is added to the parameter of the <code>post_type</code>. So only via the array  <a href="http://php.net/manual/de/function.array-merge.php"><code>array_merge</code></a> the array is added to another array.</p>
<pre>
global $wp_query;
$args = array_merge( $wp_query-&gt;query, array( &#039;post_type&#039; =&gt; &#039;my_post_type&#039; ) );
query_posts( $args );
</pre>
<p>Furthermore you can define your own queries, especially if you want to use them in your own variables, either in your Themes or Plugins.</p>
<pre>
$args = array(
	&#039;post_type&#039; =&gt; &#039;my_post_type&#039;,
	&#039;post_status&#039; =&gt; &#039;publish&#039;,
	&#039;posts_per_page&#039; =&gt; -1
);

$posts = new WP_Query( $args );
if ( $posts -&gt; have_posts() ) {
	while ( $posts -&gt; have_posts() ) {
...
	}
}

wp_reset_query();
</pre>
<p>At the end a solution that has a particular charm that you control it via Plugin and turn it off easily while testing. Also, to implement the application in a Plugin is simple or as an extension of an existing Themes via Childtheme or Plugin. About the Hook <code>pre_get_posts</code> you can adjust various things of the query, including the CPT.<br />
In the example I have via conditional tags diverse conditions implemented, so that you can see, how it responds to the output in the frontend.</p>
<pre>
// $this? - example was used in class-structures
// add custom post type to wp loop
add_filter( &#039;pre_get_posts&#039;, array( $this, &#039;add_to_query&#039;) );

// ads to query
function add_to_query( $query ) {

	if ( is_admin() || is_preview() )
		return;

	if ( ! isset( $query -&gt; query_vars&#091;&#039;suppress_filters&#039;&#093; ) )
		$query -&gt; query_vars&#091;&#039;suppress_filters&#039;&#093; = FALSE;

	// conditional tags for restrictions
	if ( is_home() || is_front_page() &amp;&amp; ( FALSE == $query -&gt; query_vars&#091;&#039;suppress_filters&#039;&#093; ) ) {
		$query -&gt; set( $this -&gt; my_post_type, array( &#039;post&#039;, $this -&gt; get_textdomain() ) );

	return $query;
}
</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/2249/wordpress-custom-post-types-get-into-the-loop/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Search Form in WP Nav Menu</title>
		<link>http://wpengineer.com/2244/search-form-in-wp-nav-menu/</link>
		<comments>http://wpengineer.com/2244/search-form-in-wp-nav-menu/#comments</comments>
		<pubDate>Fri, 29 Jul 2011 08:41:15 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[template tag]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2244</guid>
		<description><![CDATA[The WP Nav Menu is very popular and WordPress users love to implement their content in the navigation that way. Many users also like to have a search field in their navigation. In this context I found some horrible written solutions to implement the search field in the navigation. That's why I thought I write [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://codex.wordpress.org/Function_Reference/wp_nav_menu" title="Doku im Codex">WP Nav Menu</a> is very popular and WordPress users love to implement their content in the navigation that way. Many users also like to have a search field in their navigation. In this context I found some horrible written solutions to implement the search field in the navigation. That's why I thought I write a simple yet efficient solution to have the search field in your navigation. <span id="more-2244"></span></p>
<p>For this solution I'm using the default search function - <code>get_search_form()</code>. If you use it on another spot as well, please pay attention to the stylesheet. Otherwise the following snippet is sufficient to implement the search field in your navigation.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/search-wp-nav-menu.png" alt="" title="search-wp-nav-menu" width="600" height="223" class="aligncenter size-full wp-image-2245" /></p>
<p>This function and the call belongs into <code>functions.php</code> of the theme and the adjustment of the stylesheet in the according file of the theme, most of the time it is <code>style.css</code>.</p>
<pre>
function fb_add_search_box ( $items, $args ) {

	// only on primary menu
	if( &#039;primary&#039; === $args -&gt; theme_location )
		$items .= &#039;&lt;li class=&quot;menu-item menu-item-search&quot;&gt;&#039; . get_search_form( FALSE ) . &#039;&lt;/li&gt;&#039;;

	return $items;
}
add_filter( &#039;wp_nav_menu_items&#039;, &#039;fb_add_search_box&#039;, 10, 2 );
</pre>
<p>If you like to implement the search form only in a specific navigation; you just need to call the entry <code>theme_location</code> of the argument array. If it's the menu with the string n, then ... - an example:<br />
<code>if( 'primary' === $args -&gt; theme_location )</code></p>
<p><img src="http://wpengineer.com/wp-content/uploads/search-wp-nav-menu2.png" alt="" title="search-wp-nav-menu2" width="514" height="341" class="aligncenter size-full wp-image-2246" /></p>
<p>The key of the call is defined in your theme, therefore easy to find in the backend, as you can see in the screenshot above. Have fun with it!<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/2244/search-form-in-wp-nav-menu/feed/</wfw:commentRss>
		<slash:comments>2</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>Control WordPress Nav Menu via Custom Fields</title>
		<link>http://wpengineer.com/2116/control-wordpress-nav-menu-custom-fields/</link>
		<comments>http://wpengineer.com/2116/control-wordpress-nav-menu-custom-fields/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 11:22:30 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Advent Calendar]]></category>
		<category><![CDATA[Custom Fields]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2116</guid>
		<description><![CDATA[WordPress 3.0 also includes the menus, in addition to a number of other new features. Normally you generate a menu automatically by creating pages, but under Appereance / Menus you can create your own menu and assign a place where it replaces the normal menu. But whoever currently uses WordPress as a CMS and blog [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-15.jpg" alt="" title="WordPress-Christmas-2010-15" width="400" height="267" class="aligncenter size-full wp-image-2136" /><br />
WordPress 3.0 also includes the <strong>menus</strong>, in addition to a number of other new features. Normally you generate a menu automatically by creating pages, but under Appereance / Menus you can create your own menu and assign a place where it replaces the normal menu.</p>
<p>But whoever currently uses WordPress as a CMS and blog (like me) may now have a problem: If you look at the blog you should be able to see the normal pages in the navigation, but if you then select a page with many subpages it would be nice if the subpages were listed in the menu bar as well as listing only one entry "Blog" which brings you back to the blog page.</p>
<p><img src="http://wpengineer.com/wp-content/uploads/WP_Menü.png" alt="" title="WP_Menü" width="382" height="164" class="aligncenter size-full wp-image-2117" /></p>
<p>Conveniently, WordPress already includes everything you need to put together this idea. They are on the one hand of course the aforementioned menus, and on the other side there are Custom Fields. If you have not hidden, you can find at every post and every page an editor where you can enter meta data. Via this meta data and with the help of a small code snippet you can control what is displayed in the menu.</p>
<p>You can put the code snippet in your <code>functions.php</code> of your Theme or in a Plugin.</p>
<pre>
//Filter the arguments for the wp_nav_menu_function to include a custom menu on pages.
function nr_2010_wp_nav_menu_args($args = &#039;&#039;)
{
	if ( is_page() ) //custom menus only on sites
	{
		global $post;

		$menu_name = get_post_meta($post-&gt;ID, &#039;menu_name&#039;, true);

		if( !empty($menu_name) &amp;&amp; is_nav_menu($menu_name) )
		{
			$args&#091;&#039;menu&#039;&#093; = $menu_name;
		}
	}
	return $args;
}
add_filter( &#039;wp_nav_menu_args&#039;, &#039;nr_2010_wp_nav_menu_args&#039; );
</pre>
<p>This code puts a filter on <code>wp_nav_menu_args</code>, these are the parameters of the function <code>wp_nav_menu</code>, which the Theme uses to output the menus.</p>
<p>As long as we are on a page (<code>is_page()</code>) the custom field <code>menu_name</code> will be used. If it's not empty and it has a menu with this name, the paramaters of this call will be modified, so it shows the right menu.</p>
<p>Only one thing left: Provide the correct meta data to the pages and create the corresponding menus. The menu editor is very intuitive, it shouldn't be a problem. Just a hint: It doesn't save automatically. <img src='http://wpengineer.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div class="incontent">
<h4>Guest Post</h4>
<p>This post was written by Niklas Rother - <a href="http://niklas-rother.de/">niklas-rother.de</a> and is a post in our Advent Calendar Series on WP Engineer about WordPress.<br />
Thank you very much from my part to <a href="http://niklas-rother.de/">Niklas</a>.<br />
If you also like to have your interesting post published on our website, please let us know on our contact page. Of course we will appreciate your contribution!
</div>
<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/2116/control-wordpress-nav-menu-custom-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use WordPress Post Thumbnail as Background image</title>
		<link>http://wpengineer.com/2123/use-wordpress-post-thumbnail-as-background-image/</link>
		<comments>http://wpengineer.com/2123/use-wordpress-post-thumbnail-as-background-image/#comments</comments>
		<pubDate>Sun, 12 Dec 2010 11:05:34 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[post_thumbnail]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2123</guid>
		<description><![CDATA[Now and then you need in a post or page a catchy image. For editors the thumbnail function is quite comfortable to assign an image to a post or a page. Therefore it is worthwhile to use this picture as a background image for the post. However, it is much better if the image is [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-12.jpg" alt="" title="WordPress-Christmas-2010-12" width="400" height="267" class="aligncenter size-full wp-image-2129" /><img src="http://wpengineer.com/wp-content/uploads/post-thumbnail.png" alt="" title="post-thumbnail" width="303" height="171" class="alignright size-full wp-image-2124" /><br />
Now and then you need in a post or page a catchy image. For editors the thumbnail function is quite comfortable to assign an image to a post or a page. Therefore it is worthwhile to use this picture as a background image for the post. However, it is much better if the image is defined via CSS in the background and it doesn't appear in the markup. Therefore, a small function that defines a default image and if there is a defined post thumbnail, then this will be used.<br />
<span id="more-2123"></span><br />
The function is only a small solution, therefore, it must be adapted and expanded to your liking. Have fun.</p>
<pre>
/**
 * return post thumbnail inside style in head
 */
if ( !function_exists(&#039;fb_background_image&#039;) ) {

	function fb_background_image() {
		// only frontend
		if ( is_feed() || is_trackback() ) {
			return;
		}

		// default image, when no set an post thumbnail
		if ( !has_post_thumbnail($GLOBALS&#091;&#039;post&#039;&#093;-&gt;ID) ) {
			$style = &#039;&lt;style type=&quot;text/css&quot;&gt;.banner {background-image:url(\&#039;&#039; . get_bloginfo(&#039;stylesheet_directory&#039;) . &#039;/images/banner.jpg\&#039;);} &lt;/style&gt;&#039; . &quot;\n\n&quot;;
		} else {
			// get post thumbnail
			$image = wp_get_attachment_image_src(
				get_post_thumbnail_id($GLOBALS&#091;&#039;post&#039;&#093;-&gt;ID),
				&#039;banner&#039; // size for image; defined via add_image_siz
			);

			$style = sprintf(
				&#039;&lt;style type=&quot;text/css&quot;&gt;.banner {background-image:url(\&#039;%s\&#039;);}&lt;/style&gt;&#039;,
				esc_attr($image&#091;0&#093;),
				&quot;\n\n&quot;
			);
		}
		if ($style)
			echo $style;
	}

	// add functions
	add_action( &#039;wp_head&#039;, &#039;fb_background_image&#039; );
	add_theme_support( &#039;post-thumbnails&#039; );
	add_image_size( &#039;banner&#039;, 980, 350, true );

}
</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/2123/use-wordpress-post-thumbnail-as-background-image/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Custom Pagination without WordPress Plugins</title>
		<link>http://wpengineer.com/2078/custom-pagination-without-wordpress-plugins/</link>
		<comments>http://wpengineer.com/2078/custom-pagination-without-wordpress-plugins/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 10:41:09 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[Advent Calendar]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Pagination]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2078</guid>
		<description><![CDATA[On day 9 of our Advents Calendar we show a custom pagination function which allows a user to insert custom next, previous or numbered page links into a post. Use the follow code for an custom plugin or insert the function in your theme, inside the functions.php. Please see the second code-area for an example [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-09-300x200.jpg" alt="" title="WordPress-Christmas-2010-09" width="300" height="200" class="aligncenter size-medium wp-image-2100" /><br />
On day 9 of our Advents Calendar we show a custom pagination function which allows a user to insert custom next, previous or numbered page links into a post. Use the follow code for an custom plugin or insert the function in your theme, inside the functions.php. Please see the second code-area for an example to hook inside the function for custom parameters.<br />
<span id="more-2078"></span></p>
<h4>Example Screenshots</h4>
<p><img src="http://wpengineer.com/wp-content/uploads/wp-pagination2.png" alt="" title="wp-pagination2" width="138" height="41" class="size-full wp-image-2080" /> <img src="http://wpengineer.com/wp-content/uploads/wp-pagination.png" alt="" title="wp-pagination" width="145" height="74" class="size-full wp-image-2079" /></p>
<h4>The function</h4>
<p>Now the function for the pagination</p>
<pre>
function fb_paging_bar( $args = array() ) {

	$defaults = array(
		&#039;range&#039;           =&gt; 4,
		&#039;custom_query&#039;    =&gt; FALSE,
		&#039;previous_string&#039; =&gt; __( &#039;&laquo;&laquo;&laquo;&#039;, FB_GREYFOTO_TEXTDOMAIN ),
		&#039;next_string&#039;     =&gt; __( &#039;&raquo;&raquo;&raquo;&#039;, FB_GREYFOTO_TEXTDOMAIN ),
		&#039;view_fp&#039;         =&gt; TRUE,
		&#039;view_lp&#039;         =&gt; TRUE,
		&#039;before_output&#039;   =&gt; &#039;&lt;div class=&quot;postlink&quot;&gt;&#039;,
		&#039;after_output&#039;    =&gt; &#039;&lt;/div&gt;&#039;
	);

	$args = wp_parse_args(
		$args,
		apply_filters( &#039;fb_paging_bar_defaults&#039;, $defaults )
	);

	$args&#091;&#039;range&#039;&#093; = (int) $args&#091;&#039;range&#039;&#093; - 1;
	if ( !$args&#091;&#039;custom_query&#039;&#093; )
		$args&#091;&#039;custom_query&#039;&#093; = @$GLOBALS&#091;&#039;wp_query&#039;&#093;;
	$count = (int) $args&#091;&#039;custom_query&#039;&#093;-&gt;max_num_pages;
	$page  = intval( get_query_var( &#039;paged&#039; ) );
	$ceil  = ceil( $args&#091;&#039;range&#039;&#093; / 2 );

	if ( $count &lt;= 1 )
		return FALSE;

	if ( !$page )
		$page = 1;

	if ( $count &gt; $args&#091;&#039;range&#039;&#093; ) {
		if ( $page &lt;= $args&#091;&#039;range&#039;&#093; ) {
			$min = 1;
			$max = $args&#091;&#039;range&#039;&#093; + 1;
		} elseif ( $page &gt;= ($count - $ceil) ) {
			$min = $count - $args&#091;&#039;range&#039;&#093;;
			$max = $count;
		} elseif ( $page &gt;= $args&#091;&#039;range&#039;&#093; &amp;&amp; $page &lt; ($count - $ceil) ) {
			$min = $page - $ceil;
			$max = $page + $ceil;
		}
	} else {
		$min = 1;
		$max = $count;
	}

	$echo = &#039;&#039;;
	$previous = intval($page) - 1;
	$previous = esc_attr( get_pagenum_link($previous) );
	if ( $previous &amp;&amp; (1 != $page) )
		$echo .= &#039;&lt;a href=&quot;&#039; . $previous . &#039;&quot; title=&quot;&#039; . __( &#039;previous&#039;, FB_GREYFOTO_TEXTDOMAIN) . &#039;&quot;&gt;&#039; . $args&#091;&#039;previous_string&#039;&#093; . &#039;&lt;/a&gt;&#039;;
	$firstpage = esc_attr( get_pagenum_link(1) );

	if ( $args&#091;&#039;view_fp&#039;&#093; &amp;&amp; $firstpage &amp;&amp; (1 != $page) )
		$echo .= &#039;&lt;a href=&quot;&#039; . $firstpage . &#039;&quot;&gt;&#039; . __( &#039;First&#039;, FB_GREYFOTO_TEXTDOMAIN ) . &#039;&lt;/a&gt;&#039;;

	if ( !empty($min) &amp;&amp; !empty($max) ) {
		for( $i = $min; $i &lt;= $max; $i++ ) {
			if ($page == $i) {
				$echo .= &#039;&lt;span class=&quot;active&quot;&gt;&#039; . str_pad( (int)$i, 2, &#039;0&#039;, STR_PAD_LEFT ) . &#039;&lt;/span&gt;&#039;;
			} else {
				$echo .= sprintf( &#039;&lt;a href=&quot;%s&quot;&gt;%002d&lt;/a&gt;&#039;, esc_attr( get_pagenum_link($i) ), $i );
			}
		}
	}

	if ($args&#091;&#039;view_lp&#039;&#093;) {
		$lastpage = esc_attr( get_pagenum_link($count) );
		if ( $lastpage &amp;&amp; ($count != $page) ) {
			$count = str_pad( (int)$count, 2, &#039;0&#039;, STR_PAD_LEFT );
			$echo .= &#039;&lt;a href=&quot;&#039; . $lastpage . &#039;&quot;&gt;&#039; . __( &#039;Last&#039;, FB_GREYFOTO_TEXTDOMAIN ) . &#039;(&#039; . $count . &#039;)&#039; . &#039;&lt;/a&gt;&#039;;
		}
	}

	$next = intval($page) + 1;
	$next = esc_attr( get_pagenum_link($next) );
	if ($next &amp;&amp; ($count != $page) )
		$echo .= &#039;&lt;a href=&quot;&#039; . $next . &#039;&quot; title=&quot;&#039; . __( &#039;next&#039;, FB_GREYFOTO_TEXTDOMAIN) . &#039;&quot;&gt;&#039; . $args&#091;&#039;next_string&#039;&#093; . &#039;&lt;/a&gt;&#039;;

	if ( isset($echo) )
		echo $args&#091;&#039;before_output&#039;&#093; . $echo . $args&#091;&#039;after_output&#039;&#093;;
}
</pre>
<p>For use the function inside the templates use the follow syntax:</p>
<pre>
&lt;?php if ( function_exists(&#039;fb_paging_bar&#039;) ) fb_paging_bar(); ?&gt;
</pre>
<h4>Example for custom arguments</h4>
<p>For custom arguments, please use the filter. Also an example for this solution.</p>
<pre>
function change_fb_paging_bar_defaults($args) {

	$args&#091;&#039;previous_string&#039;&#093; = &#039;&#039;; // empty string
	$args&#091;&#039;next_string&#039;&#093; = &#039;&#039;;

	return $args;
}
add_filter(&#039;fb_paging_bar_defaults&#039;, &#039;change_fb_paging_bar_defaults&#039;);
</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/2078/custom-pagination-without-wordpress-plugins/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>WordPress Template Tag Reference Guide</title>
		<link>http://wpengineer.com/2108/wordpress-template-tag-reference-guide/</link>
		<comments>http://wpengineer.com/2108/wordpress-template-tag-reference-guide/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 09:51:13 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[template tag]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[WP3.0]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2108</guid>
		<description><![CDATA[There is a new, nicely organized, Reference Guide for Template Tags in WordPress 3.0. This is a nice resource next to the Codex for Template Tags. Visual nicely done and containing only the minimum information, the guide is a perfect tool when developing Themes. Have fun using it. &#169; WP Engineer Team, All rights reserved [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-032.jpg" alt="" title="WordPress-Christmas-2010-03" width="400" height="267" class="aligncenter size-full wp-image-2111" />There is a new, nicely organized, <a href="http://www.dbswebsite.com/design/wordpress-reference/V3/">Reference Guide for Template Tags</a> in WordPress 3.0. This is a nice resource next to the Codex for Template Tags. Visual nicely done and containing only the minimum information, the guide is a perfect tool when developing Themes. Have fun using it.</p>
<p><a href="http://www.dbswebsite.com/design/wordpress-reference/V3/"><img src="http://wpengineer.com/wp-content/uploads/template-tag-reference-300x277.png" alt="" title="template-tag-reference" width="300" height="277" class="aligncenter size-medium wp-image-2109" /></a></p>
<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/2108/wordpress-template-tag-reference-guide/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Custom WordPress Login-Page</title>
		<link>http://wpengineer.com/2053/custom-wordpress-login-page/</link>
		<comments>http://wpengineer.com/2053/custom-wordpress-login-page/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 10:48:26 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[WordPress Themes]]></category>
		<category><![CDATA[advent]]></category>
		<category><![CDATA[Advent Calendar]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Theme]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2053</guid>
		<description><![CDATA[In a previous post I wrote about the possibility to adjust the login page in your WordPress backend. But I still receive a lot of questions about it and I would like to point out three simple ways, so that you can customize with little effort the login page to your site - a nice [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://wpengineer.com/wp-content/uploads/WordPress-Christmas-2010-02-300x200.jpg" alt="" title="WordPress-Christmas-2010-02" width="300" height="200" class="alignleft size-medium wp-image-2088" />In a previous post I wrote about the possibility to adjust the login page in your WordPress backend. But I still receive a lot of questions about it and I would like to point out three simple ways, so that you can customize with little effort the login page to your site - a nice added value in terms of customer projects which makes it look more professional instead having always the WordPress logo and the link displayed.<br />
<span id="more-2053"></span><br />
In the first step I adjust the logo to the login page. We wrote about it <a href="http://wpengineer.com/483/create-your-own-wordpress-login-design/">here already</a>. To make it simple, just write the stylesheet in the header, in our older tutorial we included an external stylesheet.</p>
<h4>Change Logo</h4>
<p>In the first code example I include the favicon, a fast and simple way. Alternatively you can include a logo of your Theme, therefore the 2nd code example. Each of the following example belongs into the functions.php of the Themes.</p>
<pre>
function fb_custom_login_logo() {
	$style = &#039;&lt;style type=&quot;text/css&quot;&gt; h1 a { background: transparent url(&#039; . get_bloginfo(&#039;url&#039;) . &#039;/favicon.ico) no-repeat 30px center !important; } &lt;/style&gt;&#039;;
	echo $style;
}
add_action( &#039;login_head&#039;, &#039;fb_custom_login_logo&#039; );
</pre>
<pre>
function fb_custom_login_logo() {
	$style = &#039;&lt;style type=&quot;text/css&quot;&gt; h1 a { background: transparent url(&#039; . get_bloginfo(&#039;template_directory&#039;) . &#039;/images/your-logo-image.png) no-repeat center top !important; } &lt;/style&gt;&#039;;
	echo $style;
}
add_action( &#039;login_head&#039;, &#039;fb_custom_login_logo&#039; );
</pre>
<p>Now we adjusted the logo, but the name at the hover effect is still not the one we want. Therefore is a hook available.</p>
<h4>Change name</h4>
<p>We correspond with the hook and deliver with the following code snippet the name of the blog, which lies in the database. Alternatively you can query static content or your own fields.</p>
<pre>
function fb_login_headertitle() {
	return get_option(&#039;blogname&#039;);
}
add_filter( &#039;login_headertitle&#039;, &#039;fb_login_headertitle&#039; );
</pre>
<h4>Change link</h4>
<p>Now we want to adjust the link, so a klick on the logo will send us to the frontend of the website. And again, there is a hook available.</p>
<pre>
function fb_login_headerurl() {
	return home_url();
}
add_filter( &#039;login_headerurl&#039;, &#039;fb_login_headerurl&#039; );
</pre>
<p>Three simple possibilities which should belong in almost every Theme. So that the login page perfectly fits to the website. It looks more professional and your customer will be thankful.<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/2053/custom-wordpress-login-page/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

