<?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>Jorge Pedret &#187; Web Development</title>
	<atom:link href="http://jorgepedret.com/topics/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://jorgepedret.com</link>
	<description>Freelance Web Developer + Front End Designer</description>
	<lastBuildDate>Wed, 16 May 2012 21:32:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Cloning a remote WordPress site in your local computer</title>
		<link>http://jorgepedret.com/web-development/cloning-a-remote-wordpress-site-in-your-local-computer/</link>
		<comments>http://jorgepedret.com/web-development/cloning-a-remote-wordpress-site-in-your-local-computer/#comments</comments>
		<pubDate>Wed, 16 May 2012 21:30:24 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=702</guid>
		<description><![CDATA[This is a trick that I usually use when I need to clone an existing WordPress installation in my local computer.]]></description>
			<content:encoded><![CDATA[<p>This is a trick that I usually use when I need to clone an existing WordPress installation in my local computer.</p>
<ol>
<li>Clone all the remote WordPress files in your local computer.</li>
<li>Clone the remote WordPress database into your local computer.</li>
<li>Update the wp-config.php file with your local MySQL access info and database name.</li>
<li>Replace the old domain with the new domain in your local MySQL by running this commands:</li>
</ol>
<pre class="brush: sql; title: ; notranslate">
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://old.domain.com', 'http://new.domain.com');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://old.domain.com', 'http://new.domain.com');
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/cloning-a-remote-wordpress-site-in-your-local-computer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is considered a tabular data?</title>
		<link>http://jorgepedret.com/web-development/what-is-considered-a-tabular-data/</link>
		<comments>http://jorgepedret.com/web-development/what-is-considered-a-tabular-data/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 23:29:47 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[semantics]]></category>
		<category><![CDATA[tables]]></category>
		<category><![CDATA[tabular data]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=671</guid>
		<description><![CDATA[If the data was designed or positioned differently, would you still make it a table?]]></description>
			<content:encoded><![CDATA[<p>When trying to consider if some piece of data in the design is a table or not, this is a good question to ask yourself: If the data was designed or positioned differently, would you still make it a table?</p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/what-is-considered-a-tabular-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading Google Maps API on demand</title>
		<link>http://jorgepedret.com/web-development/loading-google-maps-api-on-demand/</link>
		<comments>http://jorgepedret.com/web-development/loading-google-maps-api-on-demand/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 23:17:13 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[google maps]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[lazy loading]]></category>
		<category><![CDATA[on demand]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=686</guid>
		<description><![CDATA[Here's another quick snipped that I used recently to load Google Maps on demand.]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another quick snipped that I used recently to load Google Maps on demand.</p>
<pre class="brush: jscript; title: ; notranslate">
function loadGoogleMapsApi(){
	if(typeof google === &quot;undefined&quot;){
		var script = document.createElement(&quot;script&quot;);
		script.src = &quot;https://maps.google.com/maps/api/js?sensor=false&amp;callback=loadGoogleMapsApiReady&quot;;
		document.getElementsByTagName(&quot;head&quot;)[0].appendChild(script);
	} else {
		loadGoogleMapsApiReady();
	}
}
function loadGoogleMapsApiReady(){
	$(&quot;body&quot;).trigger(&quot;gmap_loaded&quot;);
}
</pre>
<p>First we define the <code>loadGoogleMapsApi</code> function, where we include the script tag which is going to start loading Google Maps&#8217; API. Notice in line 4 how we define the callback function <code>loadGoogleMapsApiReady</code>. This is the function that will be executed after the library has been loaded.</p>
<p>The second step is defining the callback function <code>loadGoogleMapsApiReady</code>. This function simply triggers the custom even <code>gmap_loaded</code> on the body.</p>
<p>You&#8217;re all set now! Now is time to use the on demand functionality. For that you only need to attach some functionality to the custom event <code>gmap_loaded</code> triggered on the body tag. See below:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;body&quot;).bind(&quot;gmap_loaded&quot;, function(){
	alert(&quot;Google map is loaded and ready to be used!&quot;);
});
loadGoogleMapsApi();
</pre>
<p>If you want to load the Google Maps API on a button click, you could do something like this:</p>
<pre class="brush: jscript; title: ; notranslate">
$(&quot;.my-btn&quot;).click(function(){
	$(&quot;body&quot;).bind(&quot;gmap_loaded&quot;, function(){
		alert(&quot;Google map is loaded and ready to be used!&quot;);
	});
	loadGoogleMapsApi();
});
</pre>
<p>Let me know what you think and how it worked for you.</p>
<p>Here&#8217;s a link to the snippet on the gist: <a href="https://gist.github.com/2432506">https://gist.github.com/2432506</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/loading-google-maps-api-on-demand/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Require.js including multiple files and managing packages</title>
		<link>http://jorgepedret.com/web-development/require-js-including-multiple-files-and-managing-packages/</link>
		<comments>http://jorgepedret.com/web-development/require-js-including-multiple-files-and-managing-packages/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 22:54:33 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[require.js]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=682</guid>
		<description><![CDATA[This is a quick way to manage packages or including multiple files using require.js.]]></description>
			<content:encoded><![CDATA[<p>This is a quick snippet to manage packages or including multiple files using require.js.</p>
<p>I have a couple of pages that need a set of files, so instead of including one by one in all the pages, I created a function that calls requires them all, keeping the callback function.</p>
<pre class="brush: jscript; title: ; notranslate">
require_form = function (callback) {
	require([
		&quot;form&quot;,
		&quot;validate&quot;,
		&quot;multiselect&quot;,
		&quot;form_extend&quot;
		], function(){
			require([&quot;my_validate&quot;], callback);
		}
	);
};
</pre>
<p>Whenever I need to require the form set of files, I call:</p>
<pre class="brush: jscript; title: ; notranslate">
require_form(function(){
	alert('All form files are loaded!');
});
</pre>
<p>Check out code on the gist <a href="https://gist.github.com/2432457">https://gist.github.com/2432457</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/require-js-including-multiple-files-and-managing-packages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fontomas</title>
		<link>http://jorgepedret.com/web-development/fontomas/</link>
		<comments>http://jorgepedret.com/web-development/fontomas/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 00:31:10 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=672</guid>
		<description><![CDATA[This tool helps to combine iconic webfonts for your project. With fontomas you can: Make a limited symbols subset, with reduced font size, Merge symbols from several fonts to single file, Access large collections of professional-grade open source icons]]></description>
			<content:encoded><![CDATA[<p>This tool helps to combine iconic webfonts for your project. With fontomas you can:</p>
<ul>
<li>make a limited symbols subset, with reduced font size</li>
<li>merge symbols from several fonts to single file</li>
<li>access large collections of professional-grade open source icons</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/fontomas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solving postMessage issues with form submissions in IE</title>
		<link>http://jorgepedret.com/web-development/solving-postmessage-issues-with-form-submissions-in-ie/</link>
		<comments>http://jorgepedret.com/web-development/solving-postmessage-issues-with-form-submissions-in-ie/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 23:40:03 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=663</guid>
		<description><![CDATA[Last week I started using the Ben Alman jQuery plugin for posting messages between different windows. Although it worked marvellously in modern browsers, Internet Explorer wouldn&#8217;t work properly for some cases. We&#8217;re currently using postMessage/receiveMessage to dynamically resize an iframe inside our client&#8217;s page. The plugin works in most browsers, including IE. But in my case, it was [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I started using the <a href="http://benalman.com/projects/jquery-postmessage-plugin/">Ben Alman jQuery plugin</a> for posting messages between different windows. Although it worked marvellously in modern browsers, Internet Explorer wouldn&#8217;t work properly for some cases.</p>
<p>We&#8217;re currently using postMessage/receiveMessage to dynamically resize an iframe inside our client&#8217;s page. The plugin works in most browsers, including IE. But in my case, it was failing in IE when a form was submitted inside the iframe. It took us a long time to figure out the solution, but we finally came up with a fix.</p>
<p>In the plugin&#8217;s website, they show and example of how to use it to communicate between two iframes residing in two different domains (<a href="http://benalman.com/code/projects/jquery-postmessage/examples/iframe/">http://benalman.com/code/projects/jquery-postmessage/examples/iframe/</a>). I&#8217;m going to use that example to show you how to solve it.</p>
<p>After a lot of debugging, we found out that the parent_url wasn&#8217;t being set in IE after the form was submitted. So our solution was to add a hidden field that can hold the parent_url value when the iframe first loads.</p>
<p>Here&#8217;s a quick example of how to fix the issue using the example posted in the plugins&#8217;s website:</p>
<p>The child frame code</p>
<pre class="brush: jscript; title: ; notranslate">
$(function(){
	var parent_url, link;

	// Create the hidden input field that will hold the parent_url variable.
	$(&quot;form&quot;).append('&lt;input id=&quot;parent_url&quot; type=&quot;text&quot; name=&quot;parent_url&quot; /&gt;');

	// We check to see if location hash is empty. It should only go in here if you're using IE and after the form as been submitted.
	if(document.location.hash == &quot;&quot;){
		var search 		= document.location.search,
				id 				= &quot;parent_url=&quot;,
				hs_start	= search.indexOf('parent_url'),
				hs_end 		= search.indexOf('&amp;product_service');

		// Get the parent URL from the URL parameters sent by the form
		parent_url = decodeURIComponent( search.substr(hs_start + id.length, hs_end - id.length - 1) );
	}
	// If location hash is not empty, then we just assign it to the variable parent_url
	else{
		parent_url = decodeURIComponent( document.location.hash.replace( /^#/, '' ) );
	}
	// We assign the value of the parent_url to the hidden input element. That way if document.location.hash is not accessible, it can be accessed
	$(&quot;#parent_url&quot;).val(parent_url);

	// This is the function that posts a message to the parent for it to resize the iframe
	function setHeight() {
		$.postMessage({ if_height: $('body').outerHeight( true ) }, parent_url, parent );
	};

	setHeight();
});
</pre>
<p>The code for the parent window stays the same as in the example. After applying this changes, the code should work properly after submitting a form.</p>
<p>Also if you have links in your code and want your iframe to resize every time you go to a new page inside the iframe, try doing something like this in your iframe code:</p>
<pre class="brush: jscript; title: ; notranslate">
// Go through each link and append the parent_url variable to the end.
$(&quot;a&quot;).each(function() {
	$(this).attr(&quot;href&quot;, $(this).attr(&quot;href&quot;)+&quot;#&quot;+parent_url);
});
</pre>
<p>Hope this post saves somebody a bunch of hours of debugging and IE cursing. If you&#8217;re having a similar problem implementing postMessage/receiveMessage, post a comment and we can figure out together.</p>
<p><a href="https://gist.github.com/1982122">Checkout the code in the gist</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/solving-postmessage-issues-with-form-submissions-in-ie/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Placeholder text for Gravity Form input elements</title>
		<link>http://jorgepedret.com/web-development/placeholder-text-for-gravity-form-input-elements/</link>
		<comments>http://jorgepedret.com/web-development/placeholder-text-for-gravity-form-input-elements/#comments</comments>
		<pubDate>Wed, 22 Jun 2011 01:55:28 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[gravity forms]]></category>
		<category><![CDATA[placeholder]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=537</guid>
		<description><![CDATA[Surprisingly GravityForms hasn't implemented the placeholder feature yet. I know they have plans on doing so soon, but we need a solution while we wait for that. I came up with this quick solution using only GF filters and jQuery. Check it out!]]></description>
			<content:encoded><![CDATA[<p>Surprisingly GravityForms hasn&#8217;t implemented the placeholder feature yet. I know they have plans on doing so soon, but we need a solution while we wait for that.</p>
<p>I came up with this quick solution using only GF filters and jQuery.</p>
<div class="woo-sc-box info   ">Get the final code here <a href="https://gist.github.com/65dd05e3efb0fdafa6be">https://gist.github.com/65dd05e3efb0fdafa6be</a> (It&#8217;s easier to read)</div>
<h2>What the editor will look like</h2>
<p><img class="size-full wp-image-538" title="form-editor-screenshot" src="http://jorgepedret.com/wp-content/uploads/2011/06/form-editor-screenshot.png" alt="" width="528" height="718" /></p>
<h2>What the form will look like</h2>
<p><img class="alignnone size-full wp-image-539" title="form-preview-screenshot" src="http://jorgepedret.com/wp-content/uploads/2011/06/form-preview-screenshot.png" alt="" width="613" height="350" /></p>
<h2>The code</h2>
<div class="woo-sc-box info   ">Get the final code here <a href="https://gist.github.com/65dd05e3efb0fdafa6be">https://gist.github.com/65dd05e3efb0fdafa6be</a> (It&#8217;s easier to read)</div>
<h3>Add the placeholder option to the editor</h3>
<pre class="brush: php; title: ; notranslate">
/* In the functions.php file */
/* Add a custom field to the field editor (See editor screenshot) */
add_action(&quot;gform_field_standard_settings&quot;, &quot;my_standard_settings&quot;, 10, 2);
function my_standard_settings($position, $form_id){
	// Create settings on position 25 (right after Field Label)
	if($position == 25){
		?&gt;
		&lt;li class=&quot;admin_label_setting field_setting&quot; style=&quot;display: list-item; &quot;&gt;
			&lt;label for=&quot;field_placeholder&quot;&gt;Placeholder Text
				&lt;!-- Tooltip to help users understand what this field does --&gt;
				&lt;a href=&quot;javascript:void(0);&quot; class=&quot;tooltip tooltip_form_field_placeholder&quot; tooltip=&quot;&amp;lt;h6&amp;gt;Placeholder&amp;lt;/h6&amp;gt;Enter the placeholder/default text for this field.&quot;&gt;(?)&lt;/a&gt;
			&lt;/label&gt;
			&lt;input type=&quot;text&quot; id=&quot;field_placeholder&quot; class=&quot;fieldwidth-3&quot; size=&quot;35&quot; onkeyup=&quot;SetFieldProperty('placeholder', this.value);&quot;&gt;
		&lt;/li&gt;
		&lt;?php
	}
}

/* Now we execute some javascript technicalitites for the field to load correctly */
add_action(&quot;gform_editor_js&quot;, &quot;my_gform_editor_js&quot;);
function my_gform_editor_js(){
	?&gt;
	&lt;script&gt;
		//binding to the load field settings event to initialize the checkbox
		jQuery(document).bind(&quot;gform_load_field_settings&quot;, function(event, field, form){
			jQuery(&quot;#field_placeholder&quot;).val(field[&quot;placeholder&quot;]);
		});
	&lt;/script&gt;
	&lt;?php
}
</pre>
<h3>Use jQuery to inject the placeholder value to the fields</h3>
<pre class="brush: php; title: ; notranslate">
/* In the functions.php file */
/* We use jQuery to read the placeholder value and inject it to its field */
add_action('gform_enqueue_scripts',&quot;my_gform_enqueue_scripts&quot;, 10, 2);
function my_gform_enqueue_scripts($form, $is_ajax=false){
	?&gt;
	&lt;script&gt;
	jQuery(function(){
		&lt;?php
		/* Go through each one of the form fields */
		foreach($form['fields'] as $i=&gt;$field){
			/* Check if the field has an assigned placeholder */
			if(isset($field['placeholder']) &amp;&amp; !empty($field['placeholder'])){
				/* If a placeholder text exists, inject it as a new property to the field using jQuery */
				?&gt;
				jQuery('#input_&lt;?php echo $form['id']?&gt;_&lt;?php echo $field['id']?&gt;').attr('placeholder','&lt;?php echo $field['placeholder']?&gt;');
				&lt;?php
			}
		}
		?&gt;
	});
	&lt;/script&gt;
	&lt;?php
}
</pre>
<p>That&#8217;s it! take it for a spin and let me know how it goes.</p>
<div class="woo-sc-box info   ">Get the final code here <a href="https://gist.github.com/65dd05e3efb0fdafa6be">https://gist.github.com/65dd05e3efb0fdafa6be</a> (It&#8217;s easier to read)</div>
<h2>Issues</h2>
<p>Right now it only works with single lines, textareas and the other simple fields. But that&#8217;s usually the only places where you will ever need them.</p>
<h2>Internet Explorer support update</h2>
<p><a href="http://askwpgirl.com/">Angela Bowma</a> wrote a post with a <a href="http://askwpgirl.com/gravity-forms-placeholder-text-works-with-ie/">solution that works in Internet Explorer</a> or browsers that don&#8217;t support the placeholder property.</p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/placeholder-text-for-gravity-form-input-elements/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Get pages by template name in WordPress</title>
		<link>http://jorgepedret.com/web-development/get-pages-by-template-name-in-wordpress/</link>
		<comments>http://jorgepedret.com/web-development/get-pages-by-template-name-in-wordpress/#comments</comments>
		<pubDate>Tue, 21 Jun 2011 21:01:37 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[pages]]></category>
		<category><![CDATA[template name]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=535</guid>
		<description><![CDATA[Quick post to show how to retrieve pages by certain custom template. Example of use List all the published pages that use the template &#8220;page-quote.php&#8221;: How does it work? The template assigned to the page is stored as a meta data by the key &#8216;_wp_page_template&#8217;. Using the get_pages() WordPress function, we can ask for the [...]]]></description>
			<content:encoded><![CDATA[<p>Quick post to show how to retrieve pages by certain custom template. </p>
<pre class="brush: php; title: ; notranslate">
$pages = get_pages(array(
	'meta_key' =&gt; '_wp_page_template',
	'meta_value' =&gt; '&lt;Insert your template file name here&gt;'
));
</pre>
<h2>Example of use</h2>
<p>List all the published pages that use the template &#8220;page-quote.php&#8221;:</p>
<pre class="brush: php; title: ; notranslate">
$pages = get_pages(array(
	'meta_key' =&gt; '_wp_page_template',
	'meta_value' =&gt; 'page-quote.php'
));
foreach($pages as $page){
	echo $page-&gt;post_title.'&lt;br /&gt;';
}
</pre>
<h2>How does it work?</h2>
<p>The template assigned to the page is stored as a meta data by the key &#8216;_wp_page_template&#8217;. Using the get_pages() WordPress function, we can ask for the page where &#8216;_wp_page_template&#8217; equals our template name.</p>
<h2>More Info</h2>
<p><a href="http://codex.wordpress.org/Function_Reference/get_pages">get_pages() documentation</a></p>
<p>Hope this helps, post a comment if you have any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/get-pages-by-template-name-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Accessing the URL hash and parameters using Javascript</title>
		<link>http://jorgepedret.com/web-development/accessing-the-url-hash-and-parameters-using-javascript/</link>
		<comments>http://jorgepedret.com/web-development/accessing-the-url-hash-and-parameters-using-javascript/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 21:27:24 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[parameter]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=526</guid>
		<description><![CDATA[You can access the URL of your page using simple Javascript by using the following code: document.location;]]></description>
			<content:encoded><![CDATA[<p>You can access the URL of your page using simple Javascript by using the following code:</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script&gt;
my_url_object = document.location;
&lt;/script&gt;
</pre>
<p>That code yields out something like this in Chrome&#8217;s Javascript console:</p>
<p><a href="http://jorgepedret.com/wp-content/uploads/2011/06/Screen-shot-2011-06-20-at-2.10.39-PM.png"><img class="size-full wp-image-527 alignnone" title="document.location in Chrome's JS Console" src="http://jorgepedret.com/wp-content/uploads/2011/06/Screen-shot-2011-06-20-at-2.10.39-PM.png" alt="document.location in Chrome's JS Console" width="526" height="235" /></a></p>
<h2>Example of use:</h2>
<p>You can show certain section of your code depending on a hash tag in the URL:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;div id=&quot;section-1&quot; class=&quot;section&quot;&gt;Section 1&lt;/div&gt;
&lt;div id=&quot;section-2&quot; class=&quot;section&quot;&gt;Section 2&lt;/div&gt;
&lt;script&gt;
$(function(){
	// Get the hash parameter from the URL.
	active_section = document.location.hash;
	// Hide ALL the sections
	$('.section').css('display','none');
	// Show the section specified in the URL
	// The URL can be:
	// - http://localhost/example/index.html#section-1 , or
	// - http://localhost/example/index.html#section-2
	$(active_section).css('display','block');
});
&lt;/script&gt;
</pre>
<p>Post a comment if you need help! <img src='http://jorgepedret.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/accessing-the-url-hash-and-parameters-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resizing WordPress Images with AJAX Thumbnail Rebuild</title>
		<link>http://jorgepedret.com/web-development/resizing-wordpress-images-with-ajax-thumbnail-rebuild/</link>
		<comments>http://jorgepedret.com/web-development/resizing-wordpress-images-with-ajax-thumbnail-rebuild/#comments</comments>
		<pubDate>Sun, 29 May 2011 21:32:39 +0000</pubDate>
		<dc:creator>Jorge Pedret</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[add_image_size]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[pictures]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[resizing]]></category>
		<category><![CDATA[the_post_thumbnail]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://jorgepedret.com/?p=436</guid>
		<description><![CDATA[This is a quick post on how to resize images from WordPress media library after they&#8217;ve been uploaded. What&#8217;s the current problem? Once you&#8217;ve uploaded images to the media library, it&#8217;s impossible to resize them to the new sizes that you&#8217;ve added using add_image_size() function. How does AJAX Thumbnail Rebuild solves the problem? Although the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick post on how to resize images from WordPress media library after they&#8217;ve been uploaded.</p>
<div class="woo-sc-box note   ">
<h3>In a rush?</h3>
<ol>
<li>Download and install the <a href="http://wordpress.org/extend/plugins/ajax-thumbnail-rebuild/">AJAX Thumbnail Rebuild</a> plugin on your WordPress site</li>
<li>Go to &#8220;Tools &gt; Rebuild Thumbnails&#8221; and follow the steps</li>
</ol>
</div>
<h3>What&#8217;s the current problem?</h3>
<p>Once you&#8217;ve uploaded images to the media library, it&#8217;s impossible to resize them to the new sizes that you&#8217;ve added using <a href="http://codex.wordpress.org/Function_Reference/add_image_size">add_image_size()</a> function.</p>
<h3>How does AJAX Thumbnail Rebuild solves the problem?</h3>
<p>Although the name is a little bit misleading, ATR (AJAX Thumbnail Rebuild) goes through all the images that you have uploaded before and creates the new image sizes that you&#8217;ve added using the add_image_size() function.</p>
<p><small>Other similar plugins used to do all this process in the backend, which often timed out for large image libraries. That&#8217;s where ATR came up with a way to do it using AJAX and that&#8217;s why the plugin name is AJAX Thumbnail Rebuild.</small></p>
<h3>How to use it?</h3>
<p><a href="http://wordpress.org/extend/plugins/ajax-thumbnail-rebuild/"><img class="alignnone size-medium wp-image-447" title="AJAX Thumbnail Rebuild Screenshot" src="http://jorgepedret.com/wp-content/uploads/2011/05/screenshot-1-562x294.jpg" alt="AJAX Thumbnail Rebuild Screenshot" width="562" height="294" /></a></p>
<ol>
<li>Add the image sizes that you&#8217;re going to use across your site using <a href="http://codex.wordpress.org/Function_Reference/add_image_size">add_image_sizes()</a> WordPress function</li>
<li>Download and install the <a href="http://wordpress.org/extend/plugins/ajax-thumbnail-rebuild/">AJAX Thumbnail Rebuild</a> plugin on your WordPress site</li>
<li>Go to &#8220;Tools &gt; Rebuild Thumbnails&#8221;</li>
<li>Select the thumbnail sizes that you want to re-generate and click &#8220;Regenerate all Thumbnails&#8221;</li>
</ol>
<p>This is a great plugin and its functionality should really be considered to be included in WordPress.</p>
]]></content:encoded>
			<wfw:commentRss>http://jorgepedret.com/web-development/resizing-wordpress-images-with-ajax-thumbnail-rebuild/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

