<?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>Konstruktors&#187; how to</title>
	<atom:link href="http://konstruktors.com/blog/tag/how-to/feed/" rel="self" type="application/rss+xml" />
	<link>http://konstruktors.com</link>
	<description>Web Design, WordPress and Performance Services</description>
	<lastBuildDate>Fri, 10 Feb 2012 00:09:53 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19894</generator>
	<atom:link rel='hub' href='http://konstruktors.com/?pushpress=hub'/>
		<item>
		<title>How to Embed Your YouTube Channel as a&#160;Playlist</title>
		<link>http://konstruktors.com/blog/web-design/3384-embed-youtube-channel-playlist/</link>
		<comments>http://konstruktors.com/blog/web-design/3384-embed-youtube-channel-playlist/#comments</comments>
		<pubDate>Sun, 13 Nov 2011 11:43:47 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=3384</guid>
		<description><![CDATA[Update: There is an undocumented ID of your channel playlist which is available in the current beta version of YouTube UI as described by Federico in the comments. For some reason YouTube doesn&#8217;t offer a simple way to embed your YouTube channel. The only official method is to manually create a playlist with all your videos [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> There is an undocumented ID of your channel playlist which is available in the current <a href="http://www.youtube.com/cosmicpanda">beta version of YouTube UI</a> as <a href="http://konstruktors.com/blog/web-design/3384-embed-youtube-channel-playlist/#comment-11790">described by Federico</a> in the comments.</p>
<p>For some reason YouTube doesn&#8217;t offer a simple way to embed your YouTube <strong>channel</strong>. The only official method is to manually create a <strong>playlist</strong> with all your videos and embed that. However, it requires additional work after every upload which is not cool, especially if you&#8217;re on a mobile. Here is <a href="http://jsfiddle.net/q3meN/">a simple script</a> that creates an HTML5 (iframe) player using the YouTube API:</p>
<pre>(function() {
    function createPlayer(jqe, video, options) {
        var ifr = $('iframe', jqe);
        if (ifr.length === 0) {
            ifr = $('&lt;iframe scrolling="no" frameborder="no"&gt;');
            ifr.addClass('player');
            if (options.playeropts)
                ifr.attr(options.playeropts);
        }
        var src = 'http://www.youtube.com/embed/' + video;
        if (options.playopts) {
            src += '?';
            for (var k in options.playopts) {
                src+= k + '=' + options.playopts[k] + '&amp;';
            }
        }
        ifr.attr('src', src);
        jqe.append(ifr);
    }

    var defoptions = {
        autoplay: false,
        user: null,
        player: createPlayer,
        playeropts: {},
        loaded: function() {},
        playopts: {
            fs: 1,
            showinfo: 1,
            modestbranding: 1
        }
    };

    $.fn.extend({
        youTubeChannel: function(options) {
            var md = $(this);
            var allopts = $.extend(true, {}, defoptions, options);
            $.getJSON('http://gdata.youtube.com/feeds/api/users/' + allopts.user + '/uploads?alt=jsonc&amp;v=2', null, function(data) {
                var videos = [];
                var playlist = '';
                $.each(data.data.items, function(i, item) {
                    videos.push(item.id);
                    if (i &gt; 0)
                        playlist += item.id + ',';
                });
                allopts.playopts.playlist = playlist;
                allopts.player(md, videos[0], allopts);
            });
        }
    });

})();

$(function() {
    $('#player').youTubeChannel({user:'kasparsdambis', playeropts: { width: 400, height: 280 }});
});</pre>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/random-musings/1790-pari-jumtiem-lido-kaijas/' rel='bookmark' title='Pāri jumtiem lido&nbsp;kaijas'>Pāri jumtiem lido&nbsp;kaijas</a></li>
<li><a href='http://konstruktors.com/blog/random-musings/1929-sunday-with-beethoven/' rel='bookmark' title='Sunday with&nbsp;Beethoven'>Sunday with&nbsp;Beethoven</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/2610-jquery-script-for-loading-more-posts/' rel='bookmark' title='jQuery Script for Loading More&nbsp;Posts'>jQuery Script for Loading More&nbsp;Posts</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/web-design/3384-embed-youtube-channel-playlist/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Use Sticky Posts as Category&#160;Description</title>
		<link>http://konstruktors.com/blog/wordpress/3364-sticky-posts-as-category-description/</link>
		<comments>http://konstruktors.com/blog/wordpress/3364-sticky-posts-as-category-description/#comments</comments>
		<pubDate>Wed, 09 Nov 2011 14:24:56 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=3364</guid>
		<description><![CDATA[On putukrejums.lv blog we use the &#8216;sticky&#8217;posts to add introductory information to all category pages (see here, for example). This approach is better than using the category description field because it allows for all the usual formatting options. Here is how to add sticky posts on top of their respective category index pages and hide them from [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://konstruktors.com/wp-content/uploads/2011/11/putukrejums-sticky-posts-category-introduction.jpg"><img class="alignnone size-medium wp-image-3369" title="Sticky posts as Category Description" src="http://konstruktors.com/wp-content/uploads/2011/11/putukrejums-sticky-posts-category-introduction-500x330.jpg" alt="Sticky posts as Category Description" width="500" height="330" /></a></p>
<p>On <a href="http://putukrejums.lv">putukrejums.lv</a> blog we use the &#8216;sticky&#8217;posts to add introductory information to all category pages (<a href="http://putukrejums.lv/tavas-kazas/">see here</a>, for example). This approach is better than using the category description field because it allows for all the usual formatting options.<span id="more-3364"></span></p>
<p>Here is how to add sticky posts on top of their respective category index pages and hide them from the rest of pages and indexes:</p>
<pre>add_action('pre_get_posts', 'alter_stickies');
function alter_stickies($query) {
	if (!$query-&gt;is_category &amp;&amp; !$query-&gt;is_single)
		$query-&gt;set('post__not_in', get_option('sticky_posts'));
}

add_filter('posts_orderby', 'sticky_orderby');
function sticky_orderby($orderby){
	global $wpdb;
	if (is_category())
		$orderby = "Field(". $wpdb-&gt;prefix ."posts.ID," . implode(',', get_option('sticky_posts')) . ") DESC, " . $orderby;
 	return $orderby;
}</pre>
<p>Add the <code>is-sticky</code> class to the post wrap for additional formatting control:</p>
<pre>add_filter('post_class', 'add_stickies_class');
function add_stickies_class($classes) {
	if (is_sticky())
		$classes[] = 'is-sticky';
	return $classes;
}</pre>
<h3>Redirect Sticky Posts to Their Category Index Page</h3>
<p>We don&#8217;t want the sticky posts to be available as individual posts that can be access via their permalinks because this information is already being displayed at the top of every category index page. Here is a simple filter to redirect all sticky posts to their category index pages:</p>
<pre>add_action('template_redirect', 'redirect_stickies');
function redirect_stickies() {
	global $wp_query;

	if (!is_single())
		return;
	$stickies = get_option('sticky_posts');
	if (empty($stickies))
		return;

 	if (in_array($wp_query-&gt;post-&gt;ID, $stickies))
		if ($cats = get_the_category($wp_query-&gt;post-&gt;ID))
			if ($cat = end($cats))
				wp_redirect(get_category_link($cat-&gt;cat_ID), '302');
}</pre>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/3177-exclude-sticky-posts-from-adjacent-post-links/' rel='bookmark' title='How to Exclude Sticky Posts from Adjacent Post&nbsp;Links'>How to Exclude Sticky Posts from Adjacent Post&nbsp;Links</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/667-show-ads-only-to-visitors-coming-from-search-engines/' rel='bookmark' title='Show Ads Only to Visitors Coming from Search&nbsp;Engines'>Show Ads Only to Visitors Coming from Search&nbsp;Engines</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/2610-jquery-script-for-loading-more-posts/' rel='bookmark' title='jQuery Script for Loading More&nbsp;Posts'>jQuery Script for Loading More&nbsp;Posts</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/3364-sticky-posts-as-category-description/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Check Who is Tweeting About Your Blog or&#160;Website</title>
		<link>http://konstruktors.com/blog/the-web/3308-mentioning-your-blog-on-twitter/</link>
		<comments>http://konstruktors.com/blog/the-web/3308-mentioning-your-blog-on-twitter/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 16:16:32 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Meta]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=3308</guid>
		<description><![CDATA[Knowing who is talking about your blog or website on Twitter is easy &#8212; simply subscribe to the following RSS feed: http://search.twitter.com/search.rss?q=konstruktors.com Replace konstruktors.com with your own domain. Related posts Widget Context Update &#8212; Word Count&#160;Check Cite, Quote and&#160;Twitter WordPress Plugins which&#160;I&#160;Use]]></description>
			<content:encoded><![CDATA[<p>Knowing who is talking about your blog or website on Twitter is easy &#8212; simply subscribe to the following RSS feed:</p>
<pre>http://search.twitter.com/search.rss?q=konstruktors.com</pre>
<p>Replace <code>konstruktors.com</code> with your own domain.</p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/944-widget-context-update-word-count-check/' rel='bookmark' title='Widget Context Update &#8212; Word Count&nbsp;Check'>Widget Context Update &#8212; Word Count&nbsp;Check</a></li>
<li><a href='http://konstruktors.com/blog/web-design/914-cite-quote-and-twitter/' rel='bookmark' title='Cite, Quote and&nbsp;Twitter'>Cite, Quote and&nbsp;Twitter</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/831-wordpress-plugins-which-i-use/' rel='bookmark' title='WordPress Plugins which&nbsp;I&nbsp;Use'>WordPress Plugins which&nbsp;I&nbsp;Use</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/the-web/3308-mentioning-your-blog-on-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Automatically Add Image Credit or Source URL to Photo Captions in&#160;WordPress</title>
		<link>http://konstruktors.com/blog/wordpress/3203-how-to-automatically-add-image-credit-or-source-url-to-photo-captions-in-wordpress/</link>
		<comments>http://konstruktors.com/blog/wordpress/3203-how-to-automatically-add-image-credit-or-source-url-to-photo-captions-in-wordpress/#comments</comments>
		<pubDate>Sun, 16 Oct 2011 16:32:44 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=3203</guid>
		<description><![CDATA[Crediting and linking the source of any republished photo or illustration on the web is one of the most important best practices of web publishing. Unfortunately, there isn&#8217;t a standard way of doing it in WordPress and authors are left with their own decision on how and where to credit the original author or website. I [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_3205" class="wp-caption aligncenter" style="width: 510px"><img class="size-medium wp-image-3205 " title="Add image author or source URL to photos in WordPress" src="http://konstruktors.com/wp-content/uploads/2011/10/wordpress-image-photo-source-author-url-500x369.png" alt="Add image author or source URL to photos in WordPress" width="500" height="369" /><p class="wp-caption-text">Photo credit added automatically to every photo with a caption (via <a href="http://putukrejums.lv">putukrejums.lv</a>)</p></div>
<p>Crediting and linking the source of any republished photo or illustration on the web is one of the most important best practices of web publishing. Unfortunately, there isn&#8217;t a standard way of doing it in WordPress and authors are left with their own decision on how and where to credit the original author or website.<span id="more-3203"></span></p>
<p>I decided to add <strong>a simple &#8220;Source URL&#8221; input field to every image that is uploaded</strong>. Adding credit with a link to the source of that image now becomes as easy as adding a title or caption for an image:</p>
<p><a href="http://konstruktors.com/wp-content/uploads/2011/10/image-source-url-credit-dashboard.png"><img class="aligncenter size-medium wp-image-3206" title="Attached image Source URL input field" src="http://konstruktors.com/wp-content/uploads/2011/10/image-source-url-credit-dashboard-500x523.png" alt="Attached image Source URL input field" width="500" height="523" /></a></p>
<h3>Implementation</h3>
<p>You need to add the <a href="http://pastebin.com/FZJ3DJBg">following snippet of PHP</a> to your theme&#8217;s <code>functions.php</code>:</p>
<h4>Add the source URL input field to image upload screen</h4>
<pre>add_filter("attachment_fields_to_edit", "add_image_source_url", 10, 2);
function add_image_source_url($form_fields, $post) {
	$form_fields["source_url"] = array(
		"label" =&gt; __("Source URL"),
		"input" =&gt; "text",
		"value" =&gt; get_post_meta($post-&gt;ID, "source_url", true),
                "helps" =&gt; __("Add the URL where the original image was posted"),
	);
 	return $form_fields;
}

add_filter("attachment_fields_to_save", "save_image_source_url", 10 , 2);
function save_image_source_url($post, $attachment) {
	if (isset($attachment['source_url']))
		update_post_meta($post['ID'], 'source_url', esc_url($attachment['source_url']));
	return $post;
}</pre>
<h4>Automatically append the source URL to image captions</h4>
<pre>add_filter('img_caption_shortcode', 'caption_shortcode_with_credits', 10, 3);
function caption_shortcode_with_credits($empty, $attr, $content) {
	extract(shortcode_atts(array(
		'id'	=&gt; '',
		'align'	=&gt; 'alignnone',
		'width'	=&gt; '',
		'caption' =&gt; ''
	), $attr));

	// Extract attachment $post-&gt;ID
	preg_match('/\d+/', $id, $att_id);
	if (is_numeric($att_id[0]) &amp;&amp; $source_url = get_post_meta($att_id[0], 'source_url', true)) {
		$parts = parse_url($source_url);
		$caption .= ' ('. __('via') .' &lt;a href="'. $source_url .'"&gt;'. $parts['host'] .'&lt;/a&gt;)';
	}

	if (1 &gt; (int) $width || empty($caption))
		return $content;

	if ($id)
		$id = 'id="' . esc_attr($id) . '" ';

	return '&lt;div ' . $id . 'class="wp-caption ' . esc_attr($align) . '" style="width: ' . (10 + (int) $width) . 'px"&gt;'
		. do_shortcode($content) . '&lt;p class="wp-caption-text"&gt;' . $caption . '&lt;/p&gt;&lt;/div&gt;';
}</pre>
<p>Please note that the source URL will be visible only if you specify image caption upon inserting the image.</p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/1850-automatically-escape-html-entities-of-code-fragments-in-comments/' rel='bookmark' title='Automatically Escape HTML Entities of Code Fragments in&nbsp;Comments'>Automatically Escape HTML Entities of Code Fragments in&nbsp;Comments</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/2890-add-rel-attribute-to-image-links-in-wordpress-galleries/' rel='bookmark' title='Add rel Attribute to Image Links in WordPress&nbsp;Galleries'>Add rel Attribute to Image Links in WordPress&nbsp;Galleries</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/92-take-away-photo-and-image-positioning-css-styles-for-blogs-idea-for-a-plugin/' rel='bookmark' title='Take-away photo and image positioning CSS styles for blogs &#8212; idea for a&nbsp;plugin'>Take-away photo and image positioning CSS styles for blogs &#8212; idea for a&nbsp;plugin</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/3203-how-to-automatically-add-image-credit-or-source-url-to-photo-captions-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WebKit Bug: Anti-aliasing for @font-face&#160;fonts</title>
		<link>http://konstruktors.com/blog/web-design/3190-webkit-bug-anti-aliasing-for-font-face-fonts/</link>
		<comments>http://konstruktors.com/blog/web-design/3190-webkit-bug-anti-aliasing-for-font-face-fonts/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 14:43:15 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=3190</guid>
		<description><![CDATA[This is a known Webkit bug &#8212; any text with @font-face applied will be rendered without anti-aliasing if there is a text element without anti-aliasing applied preceding it. Usually those are fonts smaller than 5px or monospaced fonts at small sizes which are rendered without anti-aliasing. I noticed this bug on this page &#8212; the [...]]]></description>
			<content:encoded><![CDATA[<p>This is <a href="http://seanmcb.com/junk/webkit-antialiasing-test.html">a known Webkit bug</a> &#8212; <strong>any text with <code>@font-face</code> applied will be rendered without anti-aliasing if there is a text element without anti-aliasing applied preceding it</strong>. Usually those are fonts smaller than 5px or monospaced fonts at small sizes which are rendered without anti-aliasing.</p>
<p><a href="http://jsfiddle.net/39GZd/7/"><img class="alignnone size-full wp-image-3191" title="Webkit @font-face anti-aliasing bug due to preceding font-size" src="http://konstruktors.com/wp-content/uploads/2011/10/webkit-font-aliasing-bug.png" alt="" width="500" height="211" /></a></p>
<p>I noticed this bug on <a href="http://putukrejums.lv/kazu-abc/">this page</a> &#8212; the heading &#8220;Kāzu ABC&#8221; was rendered aliased despite having the main menu in between that heading and the logo which had <code>font-size:1px;</code> applied. The only way to fix this is by avoiding aliased text directly before elements that use @font-face.</p>
<p>Here is <a href="http://jsfiddle.net/39GZd/7/">a live demo of the bug</a>.</p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/design/158-were-back-with-a-free-font-suggestion-liberation-sans/' rel='bookmark' title='We&#8217;re back with a free font suggestion &#8212; Liberation&nbsp;Sans'>We&#8217;re back with a free font suggestion &#8212; Liberation&nbsp;Sans</a></li>
<li><a href='http://konstruktors.com/blog/web-design/1461-no-font-embedding-on-web/' rel='bookmark' title='No Font Embedding,&nbsp;Please'>No Font Embedding,&nbsp;Please</a></li>
<li><a href='http://konstruktors.com/blog/web-design/2899-replace-login-logo-with-site-name-link/' rel='bookmark' title='Replace WordPress Login Logo With Your Site&#8217;s Name and&nbsp;Link'>Replace WordPress Login Logo With Your Site&#8217;s Name and&nbsp;Link</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/web-design/3190-webkit-bug-anti-aliasing-for-font-face-fonts/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Exclude Sticky Posts from Adjacent Post&#160;Links</title>
		<link>http://konstruktors.com/blog/wordpress/3177-exclude-sticky-posts-from-adjacent-post-links/</link>
		<comments>http://konstruktors.com/blog/wordpress/3177-exclude-sticky-posts-from-adjacent-post-links/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 11:21:22 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=3177</guid>
		<description><![CDATA[add_filter('get_previous_post_where', 'remove_stickies_adjacent'); add_filter('get_next_post_where', 'remove_stickies_adjacent'); function remove_stickies_adjacent($where) { return $where . ' AND p.ID NOT IN (' . implode(',', get_option('sticky_posts')) . ')'; } Related posts Use Sticky Posts as Category&#160;Description How to Remove &#8220;View all posts filed under&#8221; Prefix from Link Title Attribute in Category&#160;Widget Enable WordPress Plugin, Theme Updates and Pretty Permalinks on&#160;Nginx]]></description>
			<content:encoded><![CDATA[<pre>add_filter('get_previous_post_where', 'remove_stickies_adjacent');
add_filter('get_next_post_where', 'remove_stickies_adjacent');
function remove_stickies_adjacent($where) {
	return $where . ' AND p.ID NOT IN (' . implode(',', get_option('sticky_posts')) . ')';
}</pre>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/3364-sticky-posts-as-category-description/' rel='bookmark' title='Use Sticky Posts as Category&nbsp;Description'>Use Sticky Posts as Category&nbsp;Description</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/3335-remove-view-all-posts-filed-under-category-widget/' rel='bookmark' title='How to Remove &#8220;View all posts filed under&#8221; Prefix from Link Title Attribute in Category&nbsp;Widget'>How to Remove &#8220;View all posts filed under&#8221; Prefix from Link Title Attribute in Category&nbsp;Widget</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/2885-enable-plugin-theme-updates-and-pretty-permalinks-nginx/' rel='bookmark' title='Enable WordPress Plugin, Theme Updates and Pretty Permalinks on&nbsp;Nginx'>Enable WordPress Plugin, Theme Updates and Pretty Permalinks on&nbsp;Nginx</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/3177-exclude-sticky-posts-from-adjacent-post-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove Inline CSS and Line Breaks in WordPress&#160;Galleries</title>
		<link>http://konstruktors.com/blog/wordpress/2920-remove-inline-css-line-breaks-galleries/</link>
		<comments>http://konstruktors.com/blog/wordpress/2920-remove-inline-css-line-breaks-galleries/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 22:07:55 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=2920</guid>
		<description><![CDATA[Inline CSS and line breaks &#60;br style="clear" /&#62; that are automatically added to the image galleries in WordPress is an example of how the needs of Automattic and WordPress.com influence the way new features are added to the WordPress core. So instead of editing every single theme on WordPress.com and adding the necessary CSS for [...]]]></description>
			<content:encoded><![CDATA[<p>Inline CSS and line breaks <code>&lt;br style="clear" /&gt;</code> that are automatically added to the image galleries in WordPress is an example of how the needs of Automattic and WordPress.com influence the way new features are added to the WordPress core. So instead of editing every single theme on WordPress.com and adding the necessary CSS for galleries to look good in all of them, they decided to put it WordPress core.</p>
<p>Here is how to replace those double line breaks with a single <code>&lt;br /&gt;</code> and remove the inline CSS:</p>
<pre><code>add_filter('the_content', 'remove_br_gallery', 11);
function remove_br_gallery($output) {
	return preg_replace('/(&lt;br[^&gt;]*&gt;\s*){2,}/', '&lt;br /&gt;', $output);
}

add_filter('use_default_gallery_style', '__return_false');
</code></pre>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/1899-smarter-cleaner-gallery/' rel='bookmark' title='Smarter Cleaner&nbsp;Gallery'>Smarter Cleaner&nbsp;Gallery</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/1770-multiple-galleries-per-post-page/' rel='bookmark' title='Multiple Galleries per&nbsp;Post/Page'>Multiple Galleries per&nbsp;Post/Page</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/3018-multiple-galleries-0-4/' rel='bookmark' title='Multiple Galleries&nbsp;0.4'>Multiple Galleries&nbsp;0.4</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/2920-remove-inline-css-line-breaks-galleries/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Simple PHP Utility to Migrate Emails Between Two IMAP/POP&#160;Accounts</title>
		<link>http://konstruktors.com/blog/the-web/2915-php-migrate-emails-imap-pop/</link>
		<comments>http://konstruktors.com/blog/the-web/2915-php-migrate-emails-imap-pop/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 18:53:46 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=2915</guid>
		<description><![CDATA[I wrote this little (quick &#38; dirty) PHP command line utility to migrate around 10 email accounts from my IMAP server to Google Apps. Related posts How to Add Simple Google Site Search to Any&#160;Website OpenID Plugin and WordPress&#160;2.8 Self-hosted HTML5 Notepad App With&#160;Synchronization]]></description>
			<content:encoded><![CDATA[<p>I wrote this <a title="Migrate / transfer email from IMAP/POP to Google Apps" href="http://t.co/9qrMZZU">little (quick &amp; dirty) PHP command line utility</a> to migrate around 10 email accounts from my IMAP server to Google Apps.</p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/web-design/2865-how-to-add-google-site-search/' rel='bookmark' title='How to Add Simple Google Site Search to Any&nbsp;Website'>How to Add Simple Google Site Search to Any&nbsp;Website</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/1241-openid-plugin-and-wordpress-2-8/' rel='bookmark' title='OpenID Plugin and WordPress&nbsp;2.8'>OpenID Plugin and WordPress&nbsp;2.8</a></li>
<li><a href='http://konstruktors.com/blog/the-web/2991-hosted-html5-notepad-app-sync/' rel='bookmark' title='Self-hosted HTML5 Notepad App With&nbsp;Synchronization'>Self-hosted HTML5 Notepad App With&nbsp;Synchronization</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/the-web/2915-php-migrate-emails-imap-pop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace WordPress Login Logo With Your Site&#8217;s Name and&#160;Link</title>
		<link>http://konstruktors.com/blog/web-design/2899-replace-login-logo-with-site-name-link/</link>
		<comments>http://konstruktors.com/blog/web-design/2899-replace-login-logo-with-site-name-link/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 09:38:32 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=2899</guid>
		<description><![CDATA[There are several plugins out there that allow you to replace the WordPress logo on the login screen. Here is a simple way to replace that logo with your site&#8217;s name &#8212; place this in your theme&#8217;s functions.php: add_filter('login_headerurl', 'my_login_url_local'); function my_login_url_local() { return get_bloginfo('url'); } add_filter('login_headertitle', 'my_login_title_attr'); function my_login_title_attr() { return esc_attr(get_bloginfo('name')); } add_action('login_head', [...]]]></description>
			<content:encoded><![CDATA[<p>There are <a href="http://wordpress.org/extend/plugins/tags/logo">several plugins</a> out there that allow you to replace the WordPress logo on the login screen. Here is a simple way to replace that logo with your site&#8217;s name &#8212; place this in your theme&#8217;s <code>functions.php</code>:</p>
<pre><code>add_filter('login_headerurl', 'my_login_url_local');
function my_login_url_local() {
	return get_bloginfo('url');
}

add_filter('login_headertitle', 'my_login_title_attr');
function my_login_title_attr() {
	return esc_attr(get_bloginfo('name'));
}

add_action('login_head', 'my_style_site_name');
function my_style_site_name() {
?&gt;
	&lt;style type="text/css"&gt;
	h1 a { width:auto; height:auto; text-indent:0; overflow:visible; text-decoration:none; color:#666; display:block; margin:0; padding:0 10px; background:none; }
	h1 a:hover { color:#000; background:none; }
	h1 { font-family:'helvetica neue', arial, sans-serif; font-weight:bold; text-align:center; font-size:2em; width:310px; position:relative; right:-8px; margin:0 0 1em 0; }
	&lt;/style&gt;
&lt;?php
}</code></pre>
<p>Here is how it will look:</p>
<p><img class="alignnone size-medium wp-image-2903 withborder" title="Custom WordPress Login Name and Link (URL)" src="http://konstruktors.com/wp-content/uploads/2011/02/wordpress-custom-login-logo-500x435.png" alt="" width="500" height="435" /></p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/2040-notes-on-the-2010-wordpress-theme/' rel='bookmark' title='Notes on the 2010 WordPress&nbsp;Theme'>Notes on the 2010 WordPress&nbsp;Theme</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/2920-remove-inline-css-line-breaks-galleries/' rel='bookmark' title='Remove Inline CSS and Line Breaks in WordPress&nbsp;Galleries'>Remove Inline CSS and Line Breaks in WordPress&nbsp;Galleries</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/3203-how-to-automatically-add-image-credit-or-source-url-to-photo-captions-in-wordpress/' rel='bookmark' title='How to Automatically Add Image Credit or Source URL to Photo Captions in&nbsp;WordPress'>How to Automatically Add Image Credit or Source URL to Photo Captions in&nbsp;WordPress</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/web-design/2899-replace-login-logo-with-site-name-link/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to Add Simple Google Site Search to Any&#160;Website</title>
		<link>http://konstruktors.com/blog/web-design/2865-how-to-add-google-site-search/</link>
		<comments>http://konstruktors.com/blog/web-design/2865-how-to-add-google-site-search/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 09:12:36 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=2865</guid>
		<description><![CDATA[Built-in search engines of WordPress, Drupal and other content management systems are good, but not as good as Google. Here is a simple way to create a Google search form that will return results only from your site: &#60;form name="google-search" method="get" action="http://www.google.com/search"&#62; &#60;input type="hidden" name="sitesearch" value="http://yourdomain.com/" /&#62; &#60;input name="q" type="text" /&#62; &#60;input type="submit" name="sa" value="Google" [...]]]></description>
			<content:encoded><![CDATA[<p>Built-in search engines of WordPress, Drupal and other content management systems are good, but not as good as Google. Here is a simple way to create a Google search form that will return results only from your site:</p>
<pre>&lt;form name="google-search" method="get" action="http://www.google.com/search"&gt;
	&lt;input type="hidden" name="sitesearch" value="http://yourdomain.com/" /&gt;
	&lt;input name="q" type="text" /&gt;
	&lt;input type="submit" name="sa" value="Google" /&gt;
&lt;/form&gt;</pre>
<p>which will look like this:</p>
<form id="google-search" name="google-search" action="http://www.google.com/search" style="margin-bottom:1.5em;">
<input name="sitesearch" type="hidden" value="http://konstruktors.com/" />
<input name="q" size="40" type="text" />
<input class="submit" name="sa" type="submit" value="Google" />
</form>
<p>This form does redirect your visitors to Google, but the results returned are only from your site, so there is nothing to worry about. And with Googling indexing blogs almost instantly, there are actually very little drawbacks from using this approach for site search.</p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/web-design/2172-optimize-for-search-engines-or-users/' rel='bookmark' title='Optimize for search engines or&nbsp;users?'>Optimize for search engines or&nbsp;users?</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/667-show-ads-only-to-visitors-coming-from-search-engines/' rel='bookmark' title='Show Ads Only to Visitors Coming from Search&nbsp;Engines'>Show Ads Only to Visitors Coming from Search&nbsp;Engines</a></li>
<li><a href='http://konstruktors.com/blog/meta/2692-google-sitelinks/' rel='bookmark' title='Google Sitelinks'>Google Sitelinks</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/web-design/2865-how-to-add-google-site-search/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
