<?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; tips</title>
	<atom:link href="http://konstruktors.com/blog/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://konstruktors.com</link>
	<description>Web Design, WordPress and Performance Services</description>
	<lastBuildDate>Sat, 19 May 2012 16:41:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-beta4-20805</generator>
<atom:link rel="hub" href="http://konstruktors.superfeedr.com/"/><atom:link rel="hub" href="http://pubsubhubbub.appspot.com/"/>		<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[snippet]]></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 How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&#160;Plugin Widget Context Update &#8212; Word Count&#160;Check Rewrite WP-Minify [...]]]></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/3478-add-post-categories-tags-as-hashtags-to-tweets-automatically-stc-plugin/' rel='bookmark' title='How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin'>How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin</a></li>
<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/wordpress/2752-rewrite-wp-minify-urls-for-css-and-js-offloading/' rel='bookmark' title='Rewrite WP-Minify URLs for CSS and JS&nbsp;Offloading'>Rewrite WP-Minify URLs for CSS and JS&nbsp;Offloading</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[snippet]]></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/3478-add-post-categories-tags-as-hashtags-to-tweets-automatically-stc-plugin/' rel='bookmark' title='How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin'>How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin</a></li>
<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/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>6</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>Enable WordPress Plugin, Theme Updates and Pretty Permalinks on&#160;Nginx</title>
		<link>http://konstruktors.com/blog/wordpress/2885-enable-plugin-theme-updates-and-pretty-permalinks-nginx/</link>
		<comments>http://konstruktors.com/blog/wordpress/2885-enable-plugin-theme-updates-and-pretty-permalinks-nginx/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 18:47:42 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Performance]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=2885</guid>
		<description><![CDATA[WordPress doesn&#8217;t know that your Nginx web server is capable of doing URL rewrites without mod_rewrite and Apache, so we explain that by adding: add_filter('got_rewrite', 'nginx_has_rewrites'); function nginx_has_rewrites() { return true; } in your theme&#8217;s functions.php. It is very likely that along Nginx you are also running PHP-FPM for all your PHP needs, and for [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress doesn&#8217;t know that your Nginx web server is capable of doing URL rewrites without <code>mod_rewrite</code> and Apache, so we explain that by adding:</p>
<pre><code>add_filter('got_rewrite', 'nginx_has_rewrites');
function nginx_has_rewrites() {
	return true;
}</code></pre>
<p>in your theme&#8217;s <code>functions.php</code>.</p>
<p>It is very likely that along Nginx you are also running PHP-FPM for all your PHP needs, and for some reason WordPress thinks its PHP process can&#8217;t write to disk. We tell WordPress that it can:</p>
<pre><code>add_filter('filesystem_method', 'nginx_make_filesystem_direct');
function nginx_make_filesystem_direct() {
	return 'direct';
}</code></pre>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/1660-enable-automatic-updates-for-plugins-hosted-by-developers/' rel='bookmark' title='Enable Automatic Updates for Plugins Hosted by&nbsp;Developers'>Enable Automatic Updates for Plugins Hosted by&nbsp;Developers</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/2752-rewrite-wp-minify-urls-for-css-and-js-offloading/' rel='bookmark' title='Rewrite WP-Minify URLs for CSS and JS&nbsp;Offloading'>Rewrite WP-Minify URLs for CSS and JS&nbsp;Offloading</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/3594-wordpress-dashboard-quick-login/' rel='bookmark' title='Enable WordPress Dashboard Quick&nbsp;Login'>Enable WordPress Dashboard Quick&nbsp;Login</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/2885-enable-plugin-theme-updates-and-pretty-permalinks-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Add Shortlink Support to Twitter&#160;Tools</title>
		<link>http://konstruktors.com/blog/wordpress/2667-how-to-add-shortlink-support-to-twitter-tools/</link>
		<comments>http://konstruktors.com/blog/wordpress/2667-how-to-add-shortlink-support-to-twitter-tools/#comments</comments>
		<pubDate>Wed, 12 Jan 2011 17:43:43 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://konstruktors.com/?p=2667</guid>
		<description><![CDATA[By default the Twitter Tools plugin uses URLs such as http://example.com/p=123 in your tweets. However, if you are using one of the URL shortener plugins (that make use of the standard get_shortlink() function), chances are that you would rather include the URL generated by that plugin. To do that, simply add this to your theme&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>By default the <a href="http://wordpress.org/extend/plugins/twitter-tools/">Twitter Tools plugin</a> uses URLs such as <code>http://example.com/p=123</code> in your tweets. However, if you are using one of the <a href="http://wordpress.org/extend/plugins/tags/url-shortener">URL shortener plugins</a> (that make use of the standard <a href="http://core.trac.wordpress.org/browser/tags/3.0.4/wp-includes/link-template.php#L2176">get_shortlink()</a> function), chances are that you would rather include the URL generated by that plugin. To do that, simply add this to your theme&#8217;s <code>functions.php</code>:</p>
<pre>add_filter('tweet_blog_post_url', 'get_shortlink_for_twitter');
function get_shortlink_for_twitter($url) {
	return wp_get_shortlink(url_to_postid($url));
}</pre>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/3478-add-post-categories-tags-as-hashtags-to-tweets-automatically-stc-plugin/' rel='bookmark' title='How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin'>How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin</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/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>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/2667-how-to-add-shortlink-support-to-twitter-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concatenate Javascript and CSS Files with WP&#160;Minify</title>
		<link>http://konstruktors.com/blog/wordpress/1573-concatenate-javascript-and-css-files-with-wp-minify/</link>
		<comments>http://konstruktors.com/blog/wordpress/1573-concatenate-javascript-and-css-files-with-wp-minify/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 12:31:00 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1573</guid>
		<description><![CDATA[Minimizing the number of HTTP requests is one of the easiest ways to make your website load significantly faster. WP Minify is a WordPress plugin by Thaya Kareeson that combines all Javascript and CSS files into one respective file. WP Minfy uses the old trick of modifying the output buffer before it is sent to [...]]]></description>
			<content:encoded><![CDATA[<p>Minimizing the number of HTTP requests is one of the easiest ways to make your website load significantly faster. <a href="http://wordpress.org/extend/plugins/wp-minify/">WP Minify</a> is a WordPress plugin by <a title="Author of WP Minify Plugin" href="http://omninoggin.com/about/">Thaya Kareeson</a> that combines all Javascript and CSS files into one respective file.</p>
<p>WP Minfy uses the old trick of modifying the <a href="http://us3.php.net/manual/en/function.ob-get-contents.php">output buffer</a> before it is sent to the user. And until all plugins and themes start using <code>wp_enqueue_script</code> and <code>wp_enqueue_style</code>, this will remain the most reliable method of doing it.</p>
<p>I approve this plugin.</p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/2491-widget-context-user-interface-update/' rel='bookmark' title='Widget Context User Interface&nbsp;Update'>Widget Context User Interface&nbsp;Update</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/3478-add-post-categories-tags-as-hashtags-to-tweets-automatically-stc-plugin/' rel='bookmark' title='How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin'>How to Add Post Categories and Tags as #Hashtags to Tweets Automatically with the Simple Twitter Connect&nbsp;Plugin</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/1573-concatenate-javascript-and-css-files-with-wp-minify/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Remove Border from Image&#160;Links</title>
		<link>http://konstruktors.com/blog/web-design/1122-remove-border-from-image-links/</link>
		<comments>http://konstruktors.com/blog/web-design/1122-remove-border-from-image-links/#comments</comments>
		<pubDate>Sat, 02 May 2009 01:09:38 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://konstruktors.com/blog/?p=1122</guid>
		<description><![CDATA[For illustrating anchor links in some cases you might want to use bottom-border instead of a default text-decoration:underline. In order to achieve that, one would use the following CSS rule: a { text-decoration:none; border-bottom:2px solid; } which also adds border to the bottom of all linked images. In order to remove it, you would think [...]]]></description>
			<content:encoded><![CDATA[<p>For illustrating anchor links in <a href="http://www.wolfslittlestore.be/2009/05/het-aimg-probleem-oplossen/">some cases</a> you might want to use <code>bottom-border</code> instead of a default <code>text-decoration:underline</code>. In order to achieve that, one would use the following CSS rule:</p>
<pre lang="css">a { text-decoration:none; border-bottom:2px solid; }</pre>
<p>which also adds border to the bottom of all linked images. In order to remove it, you would think that setting</p>
<pre lang="css">a img { border:none; }</pre>
<p>would be enough.<span id="more-1122"></span> However, the truth is that it removes only the border around the image and not the one from the anchor that surrounds it:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-1123 withborder" title="Anchor link image border before fix" src="http://konstruktors.com/wp-content/uploads/2009/05/anchor-link-border-image-before-fix.png" alt="Anchor link image border before fix" width="402" height="346" /></p>
<p>Luckily, if the image is higher than the line-height of the text, we can hide the bottom border of the image by setting:</p>
<pre lang="css">a img { border:none; vertical-align:top; }</pre>
<p>and you&#8217;re done.</p>
<p style="text-align: center;"><img class="size-full wp-image-1125 withborder aligncenter" title="Anchor link with hidden border around image" src="http://konstruktors.com/wp-content/uploads/2009/05/anchor-link-border-image-after-fix.png" alt="Anchor link with hidden border around image" width="158" height="88" /></p>
<h3>Why this works?</h3>
<p>By default both anchors and images are inline elements and by applying <code>vertical-align:top;</code> to an image inside an anchor, we move the anchor to the top of the image. For some reason images have higher <code>z-index</code> than anchors.</p>
<h4>Related posts</h4><ol>
<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>
<li><a href='http://konstruktors.com/blog/web-design/125-how-to-create-beautiful-and-elegant-html-lists-using-css/' rel='bookmark' title='How to Create Beautiful and Elegant HTML Lists Using&nbsp;CSS'>How to Create Beautiful and Elegant HTML Lists Using&nbsp;CSS</a></li>
<li><a href='http://konstruktors.com/blog/web-design/755-minimize-wordpress-2-7-dashboard-header/' rel='bookmark' title='Squeeze the Header of the New WordPress 2.7&nbsp;Dashboard'>Squeeze the Header of the New WordPress 2.7&nbsp;Dashboard</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/web-design/1122-remove-border-from-image-links/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Is Your WordPress Theme Good&#160;Enough?</title>
		<link>http://konstruktors.com/blog/wordpress/409-is-your-wordpress-theme-good-enough/</link>
		<comments>http://konstruktors.com/blog/wordpress/409-is-your-wordpress-theme-good-enough/#comments</comments>
		<pubDate>Wed, 23 Jul 2008 18:04:44 +0000</pubDate>
		<dc:creator>Kaspars</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://konstruktors.com/blog/?p=409</guid>
		<description><![CDATA[Following the release of the Tabbed Widgets plugin many people left comments saying that it doesn&#8217;t work with the theme they are using. And only then I realized how many themes do not take full advantage of widget functionality that WordPress provides by default. In this article I am going to show you how to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-410 alignright" title="WordPress Widgets" src="http://konstruktors.com/wp-content/uploads/2008/07/wordpress-widgets-illustration.png" alt="Are your widgets good enough?" width="117" height="116" /> Following the release of the <a title="Easily create tabbed and accordion type interface widgets in WordPress" href="http://konstruktors.com/blog/wordpress/322-tabbed-widgets-plugin-for-wordpress/">Tabbed Widgets plugin</a> many people left comments saying that it doesn&#8217;t work with the theme they are using. And only then I realized how many themes do not take full advantage of widget functionality that WordPress provides by default. In this article I am going to show you how to fix them.<span id="more-409"></span></p>
<h3>Widgets&#8230; hmm?</h3>
<p>Let&#8217;s think of widgets as if they were plain cardboard boxes. And let&#8217;s suppose we both are in a room full of these boxes and we are trying to figure out what is inside each of the box just by looking at them. If they all are exactly the same size, shape and color, then there is no way to differentiate between them.</p>
<p>On the web everything is built from various markup and layout boxes. In case of WordPress widgets these are usually <code>&lt;div&gt;</code> elements that semantically donate a group of content. So if there are many widgets on a page, then each of them is inside the same <code>&lt;div&gt;</code> box and there is no way to telling them apart&#8230; <em>unless</em> unique names (indentifiers) and shared surnames (classes) are applied to each of them.</p>
<h3>How the Tabbed Widgets Work</h3>
<p>All the Tabbed Widgets magic is done by two amazing JavaScript functions &#8212; <strong><a title="UI Tabs extension for jQuery" href="http://docs.jquery.com/UI/Tabs">Tabs 3</a></strong> by <a title="Author of Tabs extension for jQuery" href="http://stilbuero.de">Klaus Hartl</a> and <strong><a title="UI Accordion extension for jQuery" href="http://docs.jquery.com/UI/Accordion">Accordion</a></strong> by <a title="Author of Accordion extension for jQuery" href="http://bassistance.de/">Jörn Zaefferer</a>, which do the showing &amp; hiding, and the dynamic transitions. Plugin&#8217;s PHP backend, however, places other widgets inside those tabbed and accordion blocks.</p>
<p>Now here is the problem &#8212; those Javascript functions need to know which of the fifty seven widgets in your blog&#8217;s sidebar are the tabbed ones. Even more &#8212; there might be one tabbed and one accordion type widget, right? So how can the scripts target them?</p>
<p>Unique identifiers or names and surnames, I say, is the answer. But the reality is &#8212; many themes do not use the WordPress built-in functionality that automatically generates these identifiers.</p>
<h3>How to Fix Your WordPress Theme</h3>
<p>First, find the place where your theme defines <em>sidebar widgets</em>. This is usually done in <code>functions.php</code> file in theme&#8217;s folder but it may differ. If you can&#8217;t find it, simply go through all the theme files and search for <code>register_sidebar</code>.</p>
<p>Find the line that defines the HTML element <em>box</em> in which all the widgets are placed. It should look something like this:</p>
<pre>'before_widget' =&gt; '&lt;div ... &gt;',
'after_widget' =&gt; '&lt;/div&gt;',</pre>
<p>If it contains <strong><code>%1$s</code></strong> and <strong><code>%2$s</code></strong> then you should consider donating to the author of the theme for the great job. However, <strong>if they are not present</strong>, then replace it with</p>
<pre>'before_widget' =&gt; '&lt;div id="%1$s" class="%2$s"&gt;',
'after_widget' =&gt; '&lt;/div&gt;',</pre>
<p>and WordPress will automaticaly replace <code>%1$s</code> with a unique identifier (name) and <code>%2$s</code> with a classname (surname) of each widget.</p>
<h3>Anything Else?</h3>
<p>Yes, if you find that <code>%1$s</code> and <code>%2$s</code> are missing, please contact the author of the theme with a link to this article. Thank you.</p>
<h4>Related posts</h4><ol>
<li><a href='http://konstruktors.com/blog/wordpress/322-tabbed-widgets-plugin-for-wordpress/' rel='bookmark' title='Tabbed Widgets Plugin&nbsp;for WordPress'>Tabbed Widgets Plugin&nbsp;for WordPress</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/1797-tabbed-widgets-updated-for-wordpress-2-8/' rel='bookmark' title='Tabbed Widgets Updated for WordPress&nbsp;2.8'>Tabbed Widgets Updated for WordPress&nbsp;2.8</a></li>
<li><a href='http://konstruktors.com/blog/wordpress/2733-tabbed-widgets-update-version-1-3-1/' rel='bookmark' title='Tabbed Widgets Update: Version&nbsp;1.3.1'>Tabbed Widgets Update: Version&nbsp;1.3.1</a></li>
</ol>]]></content:encoded>
			<wfw:commentRss>http://konstruktors.com/blog/wordpress/409-is-your-wordpress-theme-good-enough/feed/</wfw:commentRss>
		<slash:comments>32</slash:comments>
		</item>
	</channel>
</rss>
