<?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>Wordpress Development Archives - Nicholas Rowe</title>
	<atom:link href="https://www.nicholas-rowe.com/category/wordpress-development/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.nicholas-rowe.com/category/wordpress-development/</link>
	<description>CEO &#38; Co-Founder - Saigon Digital</description>
	<lastBuildDate>Sun, 13 Dec 2020 09:55:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.nicholas-rowe.com/wp-content/uploads/2025/12/cropped-nick-whitebg-e1765901896660-32x32.png</url>
	<title>Wordpress Development Archives - Nicholas Rowe</title>
	<link>https://www.nicholas-rowe.com/category/wordpress-development/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>3 Simple Steps to Protecting your WordPress Website with SSL / HTTPS.</title>
		<link>https://www.nicholas-rowe.com/3-simple-steps-to-protecting-your-wordpress-website-with-ssl-https/</link>
					<comments>https://www.nicholas-rowe.com/3-simple-steps-to-protecting-your-wordpress-website-with-ssl-https/#respond</comments>
		
		<dc:creator><![CDATA[Nicholas Rowe]]></dc:creator>
		<pubDate>Fri, 13 Dec 2019 09:55:13 +0000</pubDate>
				<category><![CDATA[Wordpress Development]]></category>
		<guid isPermaLink="false">https://www.nicholas-rowe.com/?p=722</guid>

					<description><![CDATA[<p>There are tons of options out there to protect yourself with https and it can be daunting at first, but I will give my view on it and how I&#8217;ve managed dozens of WordPress websites with HTTPS over the years. Before we go any further you must obtain a SSL Certificate (usually done via your [&#8230;]</p>
<p>The post <a href="https://www.nicholas-rowe.com/3-simple-steps-to-protecting-your-wordpress-website-with-ssl-https/">3 Simple Steps to Protecting your WordPress Website with SSL / HTTPS.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>There are tons of options out there to protect yourself with https and it can be daunting at first, but I will give my view on it and how I&#8217;ve managed dozens of WordPress websites with HTTPS over the years.</p>
<p>Before we go any further you must obtain a SSL Certificate (usually done via your hosting provider). Most decent web hosting providers now offer &#8220;Let&#8217;s Encrypt&#8221; which is a free, automated, and open certificate authority brought to you by the nonprofit Internet Security Research Group (ISRG).</p>
<p>Step two is to download and install the Really Simple SSL plugin. This plugin is the best out there for me. I use it on all my WordPress websites and have done for many years. It removes the headache of different server configurations and setup for https, may it be an apache server, or nginx this plugin has all basis covered.</p>
<blockquote class="wp-embedded-content" data-secret="yKSAeqrDd7"><p><a href="https://wordpress.org/plugins/really-simple-ssl/">Really Simple SSL</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;Really Simple SSL&#8221; &#8212; Plugin Directory" src="https://wordpress.org/plugins/really-simple-ssl/embed/#?secret=03l17DFInK#?secret=yKSAeqrDd7" data-secret="yKSAeqrDd7" width="500" height="282" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>And finally, we need just need to active the plugin. As always it&#8217;s recommended you backup your website before doing this.</p>
<p>If you have any comments or questions, reach out below!</p>
<p>The post <a href="https://www.nicholas-rowe.com/3-simple-steps-to-protecting-your-wordpress-website-with-ssl-https/">3 Simple Steps to Protecting your WordPress Website with SSL / HTTPS.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nicholas-rowe.com/3-simple-steps-to-protecting-your-wordpress-website-with-ssl-https/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>iPad Media Queries</title>
		<link>https://www.nicholas-rowe.com/ipad-media-queries/</link>
					<comments>https://www.nicholas-rowe.com/ipad-media-queries/#respond</comments>
		
		<dc:creator><![CDATA[Nicholas Rowe]]></dc:creator>
		<pubDate>Wed, 01 Feb 2017 13:37:51 +0000</pubDate>
				<category><![CDATA[Wordpress Development]]></category>
		<guid isPermaLink="false">http://nicholas-rowe.com/?p=587</guid>

					<description><![CDATA[<p>iPad Media Queries (All generations &#8211; including iPad mini) Thanks to Apple&#8217;s work in creating a consistent experience for users, and easy time for developers, all 5 different iPads (iPads 1-5 and iPad mini) can be targeted with just one CSS media query. The next few lines of code should work perfect for a responsive [&#8230;]</p>
<p>The post <a href="https://www.nicholas-rowe.com/ipad-media-queries/">iPad Media Queries</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>iPad Media Queries (All generations &#8211; including iPad mini)<br />
Thanks to Apple&#8217;s work in creating a consistent experience for users, and easy time for developers, all 5 different iPads (iPads 1-5 and iPad mini) can be targeted with just one CSS media query. The next few lines of code should work perfect for a responsive design.</p>
<p>iPad in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)  { /* STYLES GO HERE */}</code><br />
iPad in landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : landscape) { /* STYLES GO HERE */}</code><br />
iPad in portrait<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : portrait) { /* STYLES GO HERE */ }</code><br />
iPad 3 &#038; 4 Media Queries<br />
If you&#8217;re looking to target only 3rd and 4th generation Retina iPads (or tablets with similar resolution) to add @2x graphics, or other features for the tablet&#8217;s Retina display, use the following media queries.</p>
<p>Retina iPad in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (-webkit-min-device-pixel-ratio: 2) { /* STYLES GO HERE */}</code><br />
Retina iPad in landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : landscape)<br />
and (-webkit-min-device-pixel-ratio: 2) { /* STYLES GO HERE */}</code><br />
Retina iPad in portrait<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : portrait)<br />
and (-webkit-min-device-pixel-ratio: 2) { /* STYLES GO HERE */ }</code><br />
iPad 1 &#038; 2 Media Queries<br />
If you&#8217;re looking to supply different graphics or choose different typography for the lower resolution iPad display, the media queries below will work like a charm in your responsive design!</p>
<p>iPad 1 &#038; 2 in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (-webkit-min-device-pixel-ratio: 1){ /* STYLES GO HERE */}</code><br />
iPad 1 &#038; 2 in landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : landscape)<br />
and (-webkit-min-device-pixel-ratio: 1)  { /* STYLES GO HERE */}</code><br />
iPad 1 &#038; 2 in portrait<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : portrait)<br />
and (-webkit-min-device-pixel-ratio: 1) { /* STYLES GO HERE */ }</code><br />
Updated on February 23, 2015<br />
iPad mini Media Queries</p>
<p>Targeting the new iPad mini with CSS definitely isn&#8217;t as difficult as it could have been. Apple thankfully made things easy on developers and gave the iPad mini the same resolution as the iPad 1 and 2.</p>
<p>As for the device-pixel-ratio of the iPad mini, I was informed by Daring Fireball&#8217;s John Gruber that this also remains the same as the iPad 1 &#038; 2.</p>
<p>This means it&#8217;s really easy for developers to target all iPads with very little code, but it also means there&#8217;s no way to specifically target an iPad mini with pure CSS. In other words, nothing is new, and you might want to make your text a tiny bit bigger.</p>
<p>iPad mini in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (-webkit-min-device-pixel-ratio: 1)  { /* STYLES GO HERE */}</code><br />
iPad mini in landscape<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : landscape)<br />
and (-webkit-min-device-pixel-ratio: 1)  { /* STYLES GO HERE */}</code><br />
iPad mini in portrait<br />
<code>@media only screen<br />
and (min-device-width : 768px)<br />
and (max-device-width : 1024px)<br />
and (orientation : portrait)<br />
and (-webkit-min-device-pixel-ratio: 1)  { /* STYLES GO HERE */ }</code><br />
iPad mini Resolution<br />
Screen Width = 768px (CSS Pixels)<br />
Screen Height = 1024px (CSS Pixels)</p>
<p>Screen Width = 768px (Actual Pixels)<br />
Screen Height = 1024px (Actual Pixels)</p>
<p>Device-pixel-ratio: 1<br />
Updated on February 23, 2015<br />
iPhone Media Queries</p>
<p>iPhone 6 Media Queries<br />
iPhone 6 in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 375px)<br />
and (max-device-width : 667px) { /* STYLES GO HERE */}</code><br />
iPhone 6 in landscape<br />
<code>@media only screen<br />
and (min-device-width : 375px)<br />
and (max-device-width : 667px)<br />
and (orientation : landscape) { /* STYLES GO HERE */}</code><br />
iPhone 6 in portrait<br />
<code>@media only screen<br />
and (min-device-width : 375px)<br />
and (max-device-width : 667px)<br />
and (orientation : portrait) { /* STYLES GO HERE */ }</code><br />
iPhone 6 Plus Media Queries<br />
iPhone 6 Plus in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 414px)<br />
and (max-device-width : 736px) { /* STYLES GO HERE */}</code><br />
iPhone 6 Plus in landscape<br />
<code>@media only screen<br />
and (min-device-width : 414px)<br />
and (max-device-width : 736px)<br />
and (orientation : landscape) { /* STYLES GO HERE */}</code><br />
iPhone 6 Plus in portrait<br />
<code>@media only screen<br />
and (min-device-width : 414px)<br />
and (max-device-width : 736px)<br />
and (orientation : portrait) { /* STYLES GO HERE */ }</code><br />
iPhone 5 &#038; 5S Media Queries<br />
iPhone 5 &#038; 5S in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 320px)<br />
and (max-device-width : 568px) { /* STYLES GO HERE */}</code><br />
iPhone 5 &#038; 5S in landscape<br />
<code>@media only screen<br />
and (min-device-width : 320px)<br />
and (max-device-width : 568px)<br />
and (orientation : landscape) { /* STYLES GO HERE */}</code><br />
iPhone 5 &#038; 5S in portrait<br />
<code>@media only screen<br />
and (min-device-width : 320px)<br />
and (max-device-width : 568px)<br />
and (orientation : portrait) { /* STYLES GO HERE */ }</code><br />
iPhone 2G, 3G, 4, 4S Media Queries<br />
It&#8217;s noteworthy that these media queries are also the same for iPod Touch generations 1-4.</p>
<p>iPhone 2G-4S in portrait &#038; landscape<br />
<code>@media only screen<br />
and (min-device-width : 320px)<br />
and (max-device-width : 480px) { /* STYLES GO HERE */}</code><br />
iPhone 2G-4S in landscape<br />
<code>@media only screen<br />
and (min-device-width : 320px)<br />
and (max-device-width : 480px)<br />
and (orientation : landscape) { /* STYLES GO HERE */}</code><br />
iPhone 2G-4S in portrait<br />
<code>@media only screen<br />
and (min-device-width : 320px)<br />
and (max-device-width : 480px)<br />
and (orientation : portrait) { /* STYLES GO HERE */ }</code><br />
iPhone 5 Resolution<br />
Screen Width = 320px (CSS Pixels)<br />
Screen Height = 568px (CSS Pixels)</p>
<p>Screen Width = 640px (Actual Pixels)<br />
Screen Height = 1136px (Actual Pixels)</p>
<p>Device-pixel-ratio: 2<br />
iPhone 4/4S Resolution<br />
Screen Width = 320px (CSS Pixels)<br />
Screen Height = 480px (CSS Pixels)</p>
<p>Screen Width = 640px (Actual Pixels)<br />
Screen Height = 960px (Actual Pixels)</p>
<p>Device-pixel-ratio: 2<br />
iPhone 2G/3G/3GS Resolution<br />
Screen Width = 320px (CSS Pixels)<br />
Screen Height = 480px (CSS Pixels)</p>
<p>Screen Width = 320px (Actual Pixels)<br />
Screen Height = 480px (Actual Pixels)</p>
<p>Device-pixel-ratio: 1<br />
Updated on February 2</p>
<p>The post <a href="https://www.nicholas-rowe.com/ipad-media-queries/">iPad Media Queries</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nicholas-rowe.com/ipad-media-queries/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Quick snippet to change all instances of WordPress URL</title>
		<link>https://www.nicholas-rowe.com/quick-snippet-to-change-all-instances-of-wordpress-url/</link>
					<comments>https://www.nicholas-rowe.com/quick-snippet-to-change-all-instances-of-wordpress-url/#respond</comments>
		
		<dc:creator><![CDATA[Nicholas Rowe]]></dc:creator>
		<pubDate>Wed, 03 Aug 2016 21:11:40 +0000</pubDate>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[Snippet]]></category>
		<guid isPermaLink="false">http://nicholas-rowe.com/?p=358</guid>

					<description><![CDATA[<p>Sometimes you are moving a websites folder structure, or sometimes you are moving a website hosts. This quick and easy sql script will allow you to update all instances of the current URL with a new URL so moving wordpress sites is painless. &#160; UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = [&#8230;]</p>
<p>The post <a href="https://www.nicholas-rowe.com/quick-snippet-to-change-all-instances-of-wordpress-url/">Quick snippet to change all instances of WordPress URL</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Sometimes you are moving a websites folder structure, or sometimes you are moving a website hosts. This quick and easy sql script will allow you to update all instances of the current URL with a new URL so moving wordpress sites is painless.</p>
<p>&nbsp;</p>
<pre class="crayon:false">UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');</pre>
<p>The post <a href="https://www.nicholas-rowe.com/quick-snippet-to-change-all-instances-of-wordpress-url/">Quick snippet to change all instances of WordPress URL</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nicholas-rowe.com/quick-snippet-to-change-all-instances-of-wordpress-url/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>WordPress SSL Offloading</title>
		<link>https://www.nicholas-rowe.com/wordpress-ssl-offloading/</link>
					<comments>https://www.nicholas-rowe.com/wordpress-ssl-offloading/#respond</comments>
		
		<dc:creator><![CDATA[Nicholas Rowe]]></dc:creator>
		<pubDate>Tue, 31 May 2016 12:25:01 +0000</pubDate>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Wordpress Development]]></category>
		<guid isPermaLink="false">http://nicholas-rowe.com/?p=352</guid>

					<description><![CDATA[<p>Understanding what’s happening When your page is accessed over HTTPS, but the Load Balancer is performing SSL offloading and actually requesting your content on the non-SSL port 80, the webserver, PHP, or anything else for that matter, does not understand or see that it&#8217;s being accessed over https://. The fix for this, is that Load [&#8230;]</p>
<p>The post <a href="https://www.nicholas-rowe.com/wordpress-ssl-offloading/">WordPress SSL Offloading</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h2><u>Understanding what’s happening</u></h2>
<p>When your page is accessed over HTTPS, but the Load Balancer is performing SSL offloading and actually requesting your content on the non-SSL port 80, the webserver, PHP, or anything else for that matter, does not understand or see that it&#8217;s being accessed over https://.</p>
<p>The fix for this, is that Load Balancer sends the de-facto standard X-Forwareded-Proto HTTP header, which we can use to figure out which protocol the client is actually using on the other side of the Load Balancer.</p>
<p>With Apache 2.2, you could use something along the lines of:</p>
<p>&lt;IfModule mod_setenvif.c&gt;</p>
<p>SetEnvIf X-Forwarded-Proto &#8220;^https$&#8221; HTTPS</p>
<p>&lt;/IfModule&gt;</p>
<p>This simply reads the X-Forwared-Proto header, and if it equals https then, sets the HTTPS environment variable to 1. PHP will see this environment variable, and eventually it will become $_SERVER[&#8216;HTTPS&#8217;] that equals 1 &#8212; just like it would be for a &#8220;real&#8221; native SSL request.</p>
<h2><u>The solution</u></h2>
<p>Websites behind load balancers or reverse proxies that support HTTP_X_FORWARDED_PROTO can be fixed by adding the following code to the wp-config.php file</p>
<p>if ($_SERVER[&#8216;HTTP_X_FORWARDED_PROTO&#8217;] == &#8216;https&#8217;)</p>
<p>$_SERVER[&#8216;HTTPS&#8217;]=&#8217;on&#8217;;</p>
<p>Then to redirect any http requests to https, we need to define the following In the .htaccess file:</p>
<p>&lt;IfModule mod_rewrite.c&gt;</p>
<p>RewriteEngine On</p>
<p><strong>RewriteCond %{HTTP:X-Forwarded-Proto} !https</strong></p>
<p><strong>RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]</strong></p>
<p>RewriteBase /</p>
<p>RewriteRule ^index\.php$ &#8211; [L]</p>
<p>RewriteCond %{REQUEST_FILENAME} !-f</p>
<p>RewriteCond %{REQUEST_FILENAME} !-d</p>
<p>RewriteRule . /index.php [L]</p>
<p>&lt;/IfModule&gt;</p>
<p>&nbsp;</p>
<p>The important parts here are in bold. Under usual circumstances inside the .htaccess file the rewrite condition would be to check for https to be set to OFF:</p>
<p>RewriteCond %{HTTPS} off</p>
<p>When behind some forms of proxying, whereby the client is connecting via HTTPS to a proxy, load balancer, Passenger application, etc., the %{HTTPS} variable may never be on and cause a rewrite loop. This is because your application is actually receiving plain HTTP traffic even though the client and the proxy/load balancer are using HTTPS. In these cases, check the X-Forwarded-Proto header.</p>
<p>References:</p>
<p><a href="http://stackoverflow.com/questions/452375/detecting-https-requests-in-php">http://stackoverflow.com/questions/452375/detecting-https-requests-in-php</a></p>
<p><a href="http://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www">http://stackoverflow.com/questions/13977851/htaccess-redirect-to-https-www</a></p>
<p>The post <a href="https://www.nicholas-rowe.com/wordpress-ssl-offloading/">WordPress SSL Offloading</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nicholas-rowe.com/wordpress-ssl-offloading/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Bundling plugins with WordPress themes.</title>
		<link>https://www.nicholas-rowe.com/bundling-plugins-with-wordpress-themes/</link>
					<comments>https://www.nicholas-rowe.com/bundling-plugins-with-wordpress-themes/#comments</comments>
		
		<dc:creator><![CDATA[Nicholas Rowe]]></dc:creator>
		<pubDate>Sun, 20 Jul 2014 23:38:12 +0000</pubDate>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[Wordpress Theming]]></category>
		<guid isPermaLink="false">http://nicholas-rowe.com/?p=316</guid>

					<description><![CDATA[<p>First off, many people will disagree with including Plugins with your themes. Yes and generally rightly so: Automatic Updates: If the plugin is freely available from WordPress.org already, then so are automatic updates to the plugin. The original author can add features, fix bugs, and deploy them quickly. Your clients and customers then benefit from on-going development. [&#8230;]</p>
<p>The post <a href="https://www.nicholas-rowe.com/bundling-plugins-with-wordpress-themes/">Bundling plugins with WordPress themes.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>First off, many people will disagree with including Plugins with your themes. Yes and generally rightly so:</p>
<ol style="color: #555555;">
<li><strong>Automatic Updates:</strong> If the plugin is freely available from WordPress.org already, then so are automatic updates to the plugin. The original author can add features, fix bugs, and deploy them quickly. Your clients and customers then benefit from on-going development. If you were to package them in your theme, though, you are essentially freezing the code at that point in time &#8211; any further updates, bug fixes, etc. would have to come <strong><em>from you</em></strong>. This means you&#8217;ll need to continuously release theme updates whenever the included plugins update.</li>
<li><strong>Core:</strong> When WordPress updates, some plugins will break. This is because the original authors didn&#8217;t take the time to remove deprecated functionality or test with new versions of WP. Do you really want to commit to maintaining your theme + someone else&#8217;s code?</li>
<li><strong>Interoperability:</strong> As the great <a style="color: #3482a5;" href="http://wordpress.stackexchange.com/users/1367/mfields">mfields</a> once said, <em>&#8220;If you&#8217;re building a bathroom and you change the wallpaper, the toilet shouldn&#8217;t disappear, too.&#8221;</em> Users should be able to swap out themes whenever they want without losing their content, their custom data, or the additional functionality they have on their site. Remember, <strong>themes are meant for presentation</strong>, plugins are meant for functionality.</li>
<li><strong>Bad Practice: </strong>Whether the theme updates or not, whether the plugin updates or not &#8230; WordPress will eventually update. Limiting your client to a single version is, frankly, insulting and bad business. Instead of hard-coding a drop-in plugin, just make your theme play nice with provided hooks and encourage users to install the other system. If you&#8217;re using WordPress hooks (actions and filters) rather than direct function calls, you aren&#8217;t risking much in terms of stability. If a hook changes, the feature is just disabled as if the plugin weren&#8217;t installed.</li>
</ol>
<p>Though there may be specific cases where including a plugin in our themes is needed. For example, a recent case where I was building a content platform for a network of sites that would use the same basic theme across each site. I needed a way to bundle these plugins with a theme. The plugins were the fantastic <a href="http://www.advancedcustomfields.com/" target="_blank">advanced custom fields</a> using the options page, the main plugin and some addons such as the repeater field.</p>
<p>I bundled all the plugins within my theme using the <a href="http://tgmpluginactivation.com/" target="_blank">TGM Plugin activation library</a>. With this plugin we create a hook and use php require_once function to call our plugins.</p>
<p><a href="http://nicholas-rowe.com/wp-content/uploads/2014/07/admin-notice.png"><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-318" src="http://nicholas-rowe.com/wp-content/uploads/2014/07/admin-notice.png" alt="admin-notice" width="860" height="425" srcset="https://www.nicholas-rowe.com/wp-content/uploads/2014/07/admin-notice.png 860w, https://www.nicholas-rowe.com/wp-content/uploads/2014/07/admin-notice-300x148.png 300w" sizes="(max-width: 860px) 100vw, 860px" /></a></p>
<p>Sources: <a href="http://wordpress.stackexchange.com/questions/22134/add-plugins-to-wordpress-theme" target="_blank">Adding plugins to WordPress themes</a>, <a href="http://wordpress.stackexchange.com/questions/20756/are-drop-in-plugins-a-product-of-design" target="_blank">Are drop-in plugins a product of design</a>, <a href="http://tgmpluginactivation.com/" target="_blank">TGM Plugin Activation</a>, <a href="http://www.advancedcustomfields.com/" target="_blank">Advanced Custom Fields</a></p>
<p>The post <a href="https://www.nicholas-rowe.com/bundling-plugins-with-wordpress-themes/">Bundling plugins with WordPress themes.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nicholas-rowe.com/bundling-plugins-with-wordpress-themes/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>One thing you didn&#8217;t know about WordPress images.</title>
		<link>https://www.nicholas-rowe.com/one-thing-you-didnt-know-about-wordpress-images/</link>
					<comments>https://www.nicholas-rowe.com/one-thing-you-didnt-know-about-wordpress-images/#respond</comments>
		
		<dc:creator><![CDATA[Nicholas Rowe]]></dc:creator>
		<pubDate>Fri, 27 Sep 2013 20:59:59 +0000</pubDate>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[Wordpress Theming]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[wordpress]]></category>
		<guid isPermaLink="false">http://nicholas-rowe.com/?p=255</guid>

					<description><![CDATA[<p>By default in WordPress when you server up a .JPEG file, WordPress optimizes the image to save bandwidth and space. 90% of the time, no one will realize this as the WordPress function behind image optimization does a fantastic job at keeping it&#8217;s quality the same, unless you are using very large high quality photo [&#8230;]</p>
<p>The post <a href="https://www.nicholas-rowe.com/one-thing-you-didnt-know-about-wordpress-images/">One thing you didn&#8217;t know about WordPress images.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>By default in WordPress when you server up a .JPEG file, WordPress optimizes the image to save bandwidth and space. 90% of the time, no one will realize this as the WordPress function behind image optimization does a fantastic job at keeping it&#8217;s quality the same, unless you are using very large high quality photo .jpeg files.</p>
<p>By default WordPress uses a default quality of 90%, if you wish to revert the image quality throw the following function in your functions.php file:</p>
<pre>
add_filter( 'jpeg_quality', 'smashing_jpeg_quality' );
function smashing_jpeg_quality() {
return 100;
}
</pre>
<p>The post <a href="https://www.nicholas-rowe.com/one-thing-you-didnt-know-about-wordpress-images/">One thing you didn&#8217;t know about WordPress images.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nicholas-rowe.com/one-thing-you-didnt-know-about-wordpress-images/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Interacting with WP_Query, listing more posts from the current category.</title>
		<link>https://www.nicholas-rowe.com/interacting-with-wp_query-listing-more-posts-from-the-current-category/</link>
					<comments>https://www.nicholas-rowe.com/interacting-with-wp_query-listing-more-posts-from-the-current-category/#respond</comments>
		
		<dc:creator><![CDATA[Nicholas Rowe]]></dc:creator>
		<pubDate>Thu, 30 May 2013 11:50:07 +0000</pubDate>
				<category><![CDATA[Wordpress Development]]></category>
		<category><![CDATA[Wordpress Theming]]></category>
		<category><![CDATA[WP_Query]]></category>
		<guid isPermaLink="false">http://nicholas-rowe.com/?p=218</guid>

					<description><![CDATA[<p>For a new project of mine I was creating a single.php for the blog side of the website. The website had a few specific categories for the blog, these being News, Races and Events. Whenever you were reading a blog post under one of these categories, the sidebar should show readers more posts from that [&#8230;]</p>
<p>The post <a href="https://www.nicholas-rowe.com/interacting-with-wp_query-listing-more-posts-from-the-current-category/">Interacting with WP_Query, listing more posts from the current category.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>For a new project of mine I was creating a single.php for the blog side of the website. The website had a few specific categories for the blog, these being News, Races and Events.</p>
<p>Whenever you were reading a blog post under one of these categories, the sidebar should show readers more posts from that specific category. May it be News, Races or Events. So we needed a way to show only the posts from the category that particular post was tagged under.</p>
<p>I decided that interacting with <a href="http://codex.wordpress.org/Class_Reference/WP_Query">WP_Query</a> here would be the best thing to do. The next thing we need to do is, because we are on a single.php page we need to find out what category that post is in. We can do this by using the <a href="http://codex.wordpress.org/Function_Reference/get_the_category">get_the_category</a> function.</p>
<pre>

// Assign get_the_category to a variable
$catData = get_the_category();

</pre>
<p>Here we have simply just stored the wordpress function get_the_category(); to a variable $catData. This is so we can use it later. The next step is to get the Category ID, in WordPress Categories are counted as Taxonomies and we can get the ID by passing the get_the_category(); variable through the term_id. Like so:</p>
<pre>

// Assign get_the_category to a variable
$catData = get_the_category();
$catID = $catData[0]-&gt;term_id;

</pre>
<p>As you can see we have a &#8216;[0]&#8217; within our $catData. This is because get_the_category returns an array of objects due to a post potentially having numerous categories. By using &#8216;0&#8217; our array will just loop through the first category. Now that we have found our current category, no matter what post single.php we are on, this will show us the category for this post, which is great if there are going to be more categories created down the line. This is a good way to future proof the website.</p>
<p>The final bit is putting this all together within the WP_Query. So let&#8217;s do that:</p>
<pre>

// Assign get_the_category to a variable
$catData = get_the_category();
$catID = $catData[0]-&amp;gt;term_id;
$query = new WP_Query(&#039;cat&#039;=.$catID);
// The Loop
if ( $query-&amp;gt;have_posts() ) {
while ( $query-&amp;gt;have_posts() ) {
$query-&amp;gt;the_post();
echo &#039;
&lt;ul&gt;
	&lt;li&gt;&#039; . get_the_title() . &#039;&lt;/li&gt;
&lt;/ul&gt;
&amp;nbsp;

&#039;;
}
} else {
// no posts found
}
</pre>
<p>This will simply loop through all the posts found in the current category and output them in a list item showing the title.</p>
<p>The post <a href="https://www.nicholas-rowe.com/interacting-with-wp_query-listing-more-posts-from-the-current-category/">Interacting with WP_Query, listing more posts from the current category.</a> appeared first on <a href="https://www.nicholas-rowe.com">Nicholas Rowe</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.nicholas-rowe.com/interacting-with-wp_query-listing-more-posts-from-the-current-category/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
