<?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/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Dev Tricks &#8211; In The Digital</title>
	<atom:link href="https://inthedigital.co.uk/category/dev-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>https://inthedigital.co.uk</link>
	<description>Web Design, Development and Digital Marketing</description>
	<lastBuildDate>Wed, 06 Aug 2025 10:55:59 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2018/10/cropped-in-the-digital-icon-padded.png?fit=32%2C32&#038;ssl=1</url>
	<title>Dev Tricks &#8211; In The Digital</title>
	<link>https://inthedigital.co.uk</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">153467252</site>	<item>
		<title>Shop Feed: Missing Color, Age and Gender values in Google Merchant Center</title>
		<link>https://inthedigital.co.uk/shop-feed-missing-color-age-and-gender-values-in-google-merchant-center/</link>
					<comments>https://inthedigital.co.uk/shop-feed-missing-color-age-and-gender-values-in-google-merchant-center/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Tue, 26 Nov 2024 18:13:37 +0000</pubDate>
				<category><![CDATA[Adwords PPC]]></category>
		<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[Pay Per Click]]></category>
		<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[Missing value]]></category>
		<category><![CDATA[Shop]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2742</guid>

					<description><![CDATA[<img width="300" height="231" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/google-merchant-center-missing-values.png?fit=300%2C231&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="How to fix: Missing value: size [size], colour [color], gender [gender], age group [age_group]" style="float: none; margin: auto;" decoding="async" fetchpriority="high" />How to fix: Missing value: size [size], colour [color], gender [gender], age group [age_group] in feeds for Google Merchant Center and Google Ads]]></description>
										<content:encoded><![CDATA[<img width="300" height="231" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2024/11/google-merchant-center-missing-values.png?fit=300%2C231&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="How to fix: Missing value: size [size], colour [color], gender [gender], age group [age_group]" style="float: none; margin: auto;" decoding="async" /><p>Missing value: size [size], color [color], gender [gender], age group [age_group]. Are you getting any of these notifications in Google Merchant Center and Googe Ads? If so, here are several different ways to fix it.</p>
<h2 style="margin-bottom: 0!important;">Overview: ways to fix the feed</h2>
<ol>
<li>Create Product Attributes</li>
<li>Create Product Custom Meta</li>
<li>Create Literal Value in the Feed</li>
<li>Update Feed Manually in Google Merchant Center</li>
</ol>
<p>Any of the above will fix the issue with missing values. I&#8217;ll elaborate on each approach at a later date. For now, if you need help, reach out and I&#8217;ll help/update the post.</p>
<h2 style="margin-bottom: 0!important;">Resources</h2>
<ul>
<li>Color attribute&#8217;s acceptable values:<br />
<a href="https://support.google.com/merchants/answer/6324487" target="_blank" rel="noopener nofollow">https://support.google.com/merchants/answer/6324487</a></li>
<li>Age attribute&#8217;s acceptable values:<br />
<a href="https://support.google.com/merchants/answer/6324463" target="_blank" rel="noopener nofollow">https://support.google.com/merchants/answer/6324463</a></li>
<li>Gender attribute&#8217;s acceptable values:<br />
<a href="https://support.google.com/merchants/answer/6324479" target="_blank" rel="noopener nofollow">https://support.google.com/merchants/answer/6324479</a></li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/shop-feed-missing-color-age-and-gender-values-in-google-merchant-center/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2742</post-id>	</item>
		<item>
		<title>How to password protect an external drive for Macs</title>
		<link>https://inthedigital.co.uk/how-to-password-protect-an-external-drive-for-macs/</link>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Fri, 15 Dec 2023 12:27:50 +0000</pubDate>
				<category><![CDATA[Data Privacy]]></category>
		<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[Encryption]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2683</guid>

					<description><![CDATA[<img width="256" height="256" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/disk-util-icon.png?fit=256%2C256&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="How to password protect an external drive for Macs. In The Digital. disk util icon" style="float: none; margin: auto;" decoding="async">Protect your external drives in 7 simples steps. Follow this guide to easily protect external drives for Macs and MacBooks in only a few minutes.]]></description>
										<content:encoded><![CDATA[<img width="256" height="256" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/disk-util-icon.png?fit=256%2C256&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="How to password protect an external drive for Macs. In The Digital. disk util icon" style="float: none; margin: auto;" decoding="async" loading="lazy"><p>Here are the steps we take to protect an external hard drive:</p>
<ol>
<li>Open Disk Utilities</li>
<li>Select the drive to protect</li>
<li>Select Erase</li>
<li>Rename the drive</li>
<li>Provide a secure password and a useful hint</li>
<li>Erase and recreate the password protected drive</li>
<li>Enjoy protect external assets</li>
</ol>
<h2>1. Open Disk Utilities</h2>
<div class="row d-flex" style="display: flex; align-items: center;">
<div class="col-auto"><img loading="lazy" decoding="async" class="thumbnail alignleft wp-image-2689 size-thumbnail" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/utilities-folder-icon.png?resize=150%2C150&#038;ssl=1" alt="How to password protect an external drive for Macs. In The Digital. utilities folder icon" width="150" height="150" srcset="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/utilities-folder-icon.png?resize=150%2C150&amp;ssl=1 150w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/utilities-folder-icon.png?resize=300%2C300&amp;ssl=1 300w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/utilities-folder-icon.png?w=1024&amp;ssl=1 1024w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/utilities-folder-icon.png?resize=768%2C768&amp;ssl=1 768w" sizes="(max-width: 150px) 100vw, 150px" data-recalc-dims="1" /></div>
<div class="col-auto">&gt;</div>
<div class="col-auto"><img loading="lazy" decoding="async" class="thumbnail alignleft wp-image-2688 size-thumbnail" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/disk-util-icon.png?resize=150%2C150&#038;ssl=1" alt="How to password protect an external drive for Macs. In The Digital. disk util icon" width="150" height="150" srcset="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/disk-util-icon.png?resize=150%2C150&amp;ssl=1 150w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/disk-util-icon.png?w=256&amp;ssl=1 256w" sizes="(max-width: 150px) 100vw, 150px" data-recalc-dims="1" /></div>
</div>
<h2>2. Select the drive to protect</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2694" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-drive-from-disk-utilities.png?resize=843%2C483&#038;ssl=1" alt="How to password protect an external drive for Macs. In The Digital. select drive from disk utilities" width="843" height="483" srcset="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-drive-from-disk-utilities.png?w=843&amp;ssl=1 843w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-drive-from-disk-utilities.png?resize=300%2C172&amp;ssl=1 300w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-drive-from-disk-utilities.png?resize=768%2C440&amp;ssl=1 768w" sizes="(max-width: 843px) 100vw, 843px" data-recalc-dims="1" /></p>
<h2>3. Select &#8216;Erase&#8217;</h2>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-2696 size-full" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/rename-drive.png?resize=843%2C483&#038;ssl=1" alt="Renaming external drive on a Mac" width="843" height="483" srcset="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/rename-drive.png?w=843&amp;ssl=1 843w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/rename-drive.png?resize=300%2C172&amp;ssl=1 300w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/rename-drive.png?resize=768%2C440&amp;ssl=1 768w" sizes="(max-width: 843px) 100vw, 843px" data-recalc-dims="1" /></p>
<h2>4. Rename the drive</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2697" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-journaled-encrypted.png?resize=843%2C483&#038;ssl=1" alt="Select Mac OS Extended (Journaled, Encrypted)" width="843" height="483" srcset="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-journaled-encrypted.png?w=843&amp;ssl=1 843w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-journaled-encrypted.png?resize=300%2C172&amp;ssl=1 300w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/select-journaled-encrypted.png?resize=768%2C440&amp;ssl=1 768w" sizes="(max-width: 843px) 100vw, 843px" data-recalc-dims="1" /></p>
<h2>5. Provide a secure password and a useful hint</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2699" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/set-complex-auto-generate-password-for-external-drive.png?resize=845%2C484&#038;ssl=1" alt="set complex auto-generate password for external drive" width="845" height="484" srcset="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/set-complex-auto-generate-password-for-external-drive.png?w=845&amp;ssl=1 845w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/set-complex-auto-generate-password-for-external-drive.png?resize=300%2C172&amp;ssl=1 300w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/set-complex-auto-generate-password-for-external-drive.png?resize=768%2C440&amp;ssl=1 768w" sizes="(max-width: 845px) 100vw, 845px" data-recalc-dims="1" /></p>
<h2>6. Erase and recreate the password protected drive</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2701" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/erasing-and-recreating-password-protected-drive.png?resize=843%2C483&#038;ssl=1" alt="Erasing and recreating password protected drive for Macs" width="843" height="483" srcset="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/erasing-and-recreating-password-protected-drive.png?w=843&amp;ssl=1 843w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/erasing-and-recreating-password-protected-drive.png?resize=300%2C172&amp;ssl=1 300w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/erasing-and-recreating-password-protected-drive.png?resize=768%2C440&amp;ssl=1 768w" sizes="(max-width: 843px) 100vw, 843px" data-recalc-dims="1" /></p>
<h2>7. Enjoy protect external assets</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2702" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/drive-created-and-password-protected-for-use-on-macs.png?resize=843%2C483&#038;ssl=1" alt="Drive created and password protected for use on Macs" width="843" height="483" srcset="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/drive-created-and-password-protected-for-use-on-macs.png?w=843&amp;ssl=1 843w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/drive-created-and-password-protected-for-use-on-macs.png?resize=300%2C172&amp;ssl=1 300w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2023/12/drive-created-and-password-protected-for-use-on-macs.png?resize=768%2C440&amp;ssl=1 768w" sizes="(max-width: 843px) 100vw, 843px" data-recalc-dims="1" /></p>
<p>Disk was: Elements<br />
Disk now: TimeMachine MacBook Pro</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2683</post-id>	</item>
		<item>
		<title>How to fix vagrant error &#8220;tee: /etc/exports: Operation not permitted&#8221;</title>
		<link>https://inthedigital.co.uk/how-to-fix-vagrant-error-tee-etc-exports-operation-not-permitted/</link>
					<comments>https://inthedigital.co.uk/how-to-fix-vagrant-error-tee-etc-exports-operation-not-permitted/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Tue, 10 May 2022 10:49:21 +0000</pubDate>
				<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[Vagrant]]></category>
		<category><![CDATA[Virtual Machine]]></category>
		<category><![CDATA[VM]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2604</guid>

					<description><![CDATA[<img width="297" height="300" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2018/11/Incompatible-App.png?fit=297%2C300&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Incompatible macOS Application - VirtualBox" style="float: none; margin: auto;" decoding="async" loading="lazy" />Also, how to fix &#8220;nfsd service does not appear to be running&#8221; This solution is for Mac users only &#8211; thanks CW. Short answer: Open &#8220;System Settings&#8221; Unlock padlock Select &#8220;Full Disk Access&#8221; Add &#8220;Terminal&#8221; (or whatever you use) Close padlock Restart Terminal (if open)]]></description>
										<content:encoded><![CDATA[<img width="297" height="300" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2018/11/Incompatible-App.png?fit=297%2C300&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Incompatible macOS Application - VirtualBox" style="float: none; margin: auto;" decoding="async" loading="lazy" /><p>Also, how to fix &#8220;nfsd service does not appear to be running&#8221;</p>
<p>This solution is for Mac users only &#8211; thanks <a href="https://cubewebsites.com/software/quick-fix-macos-mojave-vagrant-error-tee-etc-exports-operation-not-permitted/" target="_blank" rel="nofollow noopener">CW</a>.</p>
<p>Short answer:</p>
<ol>
<li>Open &#8220;System Settings&#8221;</li>
<li>Unlock padlock</li>
<li>Select &#8220;Full Disk Access&#8221;</li>
<li>Add &#8220;Terminal&#8221; (or whatever you use)</li>
<li>Close padlock</li>
<li>Restart Terminal (if open)</li>
</ol>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/how-to-fix-vagrant-error-tee-etc-exports-operation-not-permitted/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2604</post-id>	</item>
		<item>
		<title>How to add WP&#8217;s customizer CSS into the classic editor</title>
		<link>https://inthedigital.co.uk/how-to-add-customizer-custom-css-into-wps-classic-editor/</link>
					<comments>https://inthedigital.co.uk/how-to-add-customizer-custom-css-into-wps-classic-editor/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Sat, 23 Apr 2022 08:25:56 +0000</pubDate>
				<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Custom CSS]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2600</guid>

					<description><![CDATA[Recently, a newly acquired client needed the styling from the Customizer&#8217;s custom CSS to show in the classic editor (TinyMCE). In all my years of working with WordPress, this was the first time I&#8217;d had this request, so, knowing that you can inject styling into the TinyMCE editor, I set about finding a solution. There [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Recently, a newly acquired client needed the styling from the Customizer&#8217;s custom CSS to show in the classic editor (TinyMCE). In all my years of working with WordPress, this was the first time I&#8217;d had this request, so, knowing that you can inject styling into the TinyMCE editor, I set about finding a solution.</p>
<p>There are several ways to add custom styling to the classic editor, including:</p>
<ul>
<li>loading a custom stylesheet, using <code>add_editor_style(&#039;custom-editor-style.css&#039;)</code>,</li>
<li>loading a custom stylesheet, using <code>add_filter(&#039;mce_css&#039;)</code>, and</li>
<li>loading dynamic styles, using <code>add_filter(&#039;tiny_mce_before_init&#039;)</code> and appending style properties to <code>$settings[&#039;content_style&#039;]</code>.</li>
</ul>
<p>In this post, we&#8217;ll focus on the latter, which we can use to get the Customizer&#8217;s CSS.</p>
<h2>Loading Customizer CSS into the Classic Editor</h2>
<p>The Customizer&#8217;s theme CSS is stored in the <code>post</code> table, with post type <code>custom_css</code>. To get this we&#8217;ll use get_posts(), then we&#8217;ll append the <code>post_content</code> to <code>$mce_settings[&#039;content_style&#039;]</code> (after sanitising it). Here&#8217;s the WordPress filter, note that I&#8217;ve used an anonymous function, but you don&#8217;t have to:</p>
<pre><code class="language-php">add_filter(&#039;tiny_mce_before_init&#039;, function ($mce_init) {
    $customizer_posts = get_posts(&#039;post_type=custom_css&amp;numberposts=1&#039;);
    $styles = $customizer_posts[0]-&gt;post_content ?? &#039;&#039;;
    
    // return early if no stlying was found
    if (!$styles) return $mce_init;
    
    // sanitise ready for use
    $styles = sanitize_text_field($styles);
    
    // add styling
    if (isset($mce_init[&#039;content_style&#039;])) {
        $mce_init[&#039;content_style&#039;] .= &quot; $styles &quot;;
    } else {
        $mce_init[&#039;content_style&#039;] = &quot; $styles &quot;;
    }
    
    // return updated settings
    return $mce_init;
});</code></pre>
<p>And that&#8217;s how to add customizer CSS into the classic editor.</p>
<p>If you&#8217;re struggling with this or any other WordPress challenge, don&#8217;t hesitate to get in touch for further support.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/how-to-add-customizer-custom-css-into-wps-classic-editor/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2600</post-id>	</item>
		<item>
		<title>How to reveal the footer from under the content, using position sticky</title>
		<link>https://inthedigital.co.uk/how-to-reveal-a-footer-with-position-sticky/</link>
					<comments>https://inthedigital.co.uk/how-to-reveal-a-footer-with-position-sticky/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Tue, 19 Apr 2022 07:47:08 +0000</pubDate>
				<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS layout]]></category>
		<category><![CDATA[Custom CSS]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2593</guid>

					<description><![CDATA[<img width="300" height="256" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/04/media-query-hover.jpg?fit=300%2C256&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Detecting mobile devices using CSS media query hover" style="float: none; margin: auto;" decoding="async" loading="lazy" />Once upon a time, a challenge like this, where you want to reveal a footer when the end of the content is reached, would have needed position: fixed&#124;absolute and a bit of JavaScript to calculate the dynamic height of the footer, for responsiveness. Thankfully, we now have a much simpler solution, using sticky positioning. With [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="300" height="256" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/04/media-query-hover.jpg?fit=300%2C256&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Detecting mobile devices using CSS media query hover" style="float: none; margin: auto;" decoding="async" loading="lazy" /><p>Once upon a time, a challenge like this, where you want to reveal a footer when the end of the content is reached, would have needed <code>position: fixed|absolute</code> and a bit of JavaScript to calculate the dynamic height of the footer, for responsiveness.</p>
<p>Thankfully, we now have a much simpler solution, using sticky positioning. With <code>position: sticky</code> we don&#8217;t need to worry too much about the height of the footer, we can simply set a sensible minimum viewport size that we&#8217;re confident the footer will fit in and voila, a footer that reveals from underneath the content above it.</p>
<h2>Code example to reveal a footer</h2>
<pre><code class="language-css">@media (min-width: 1200px) and (min-height: 600px) {
    .any-preceding-siblings {
        z-index: 2;
    }
    
    footer {
        position: sticky;
        bottom: 0;
        z-index: 1;
    }
}</code></pre>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position" target="_blank" rel="noopener nofollow">Sticky positioning</a>, like many styling customisations, is easy when you know what can be achieved with <a href="https://www.w3.org/TR/2018/REC-selectors-3-20181106/" target="_blank" rel="nofollow noopener">CSS3</a> and <a href="https://www.w3.org/TR/selectors-4/" target="_blank" rel="nofollow noopener">CSS4</a>. If you&#8217;re looking for help with custom styling or would like help designing your web pages, please reach out and we&#8217;ll gladly help.</p>
<p>Check out our other CSS tips: <a href="https://inthedigital.co.uk/tag/css/">CSS</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/how-to-reveal-a-footer-with-position-sticky/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2593</post-id>	</item>
		<item>
		<title>How to fix the PhpStorm error, &#8220;The IDE cannot create the directory&#8221;, in under a minute</title>
		<link>https://inthedigital.co.uk/how-to-fix-the-phpstorm-error-the-ide-cannot-create-the-directory-in-under-a-minute/</link>
					<comments>https://inthedigital.co.uk/how-to-fix-the-phpstorm-error-the-ide-cannot-create-the-directory-in-under-a-minute/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Wed, 06 Apr 2022 09:44:00 +0000</pubDate>
				<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[IDE troubleshooting]]></category>
		<category><![CDATA[PHPStorm]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2571</guid>

					<description><![CDATA[<img width="300" height="300" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2022/04/php-storm-ide-error.png?fit=300%2C300&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="PhpStorm application error" style="float: none; margin: auto;" decoding="async" loading="lazy" />On a couple of occasions, I&#8217;ve encountered a very annoying issue where PhpStorm will not open. Instead of opening it throws up the error message, &#8220;the IDE cannot create the directory.&#8221;, in a modal window. I&#8217;m using JetBrains&#8217; Toolbox to manage their IDEs and on the whole it&#8217;s a great little app to navigate their [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="300" height="300" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2022/04/php-storm-ide-error.png?fit=300%2C300&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="PhpStorm application error" style="float: none; margin: auto;" decoding="async" loading="lazy" /><p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-2572" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2022/04/php-storm-ide-cannot-create-the-directory.png?resize=800%2C250&#038;ssl=1" alt="PHPStorm modal error showing the message, &quot;The IDE cannot create the directory&quot;" width="800" height="250" srcset="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2022/04/php-storm-ide-cannot-create-the-directory.png?w=800&amp;ssl=1 800w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2022/04/php-storm-ide-cannot-create-the-directory.png?resize=300%2C94&amp;ssl=1 300w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2022/04/php-storm-ide-cannot-create-the-directory.png?resize=768%2C240&amp;ssl=1 768w" sizes="(max-width: 800px) 100vw, 800px" data-recalc-dims="1" /></p>
<p>On a couple of occasions, I&#8217;ve encountered a very annoying issue where PhpStorm will not open. Instead of opening it throws up the error message, &#8220;the IDE cannot create the directory.&#8221;, in a modal window.</p>
<p>I&#8217;m using JetBrains&#8217; Toolbox to manage their IDEs and on the whole it&#8217;s a great little app to navigate their many IDEs and reopen an existing project. But, like a lot of software that we come to rely on, it&#8217;s a complete pain in the arse when it, seemingly out of the blue, stops working.</p>
<h2>Why is PhpStorm not loading from the JetBrains Toolbox app?</h2>
<p>The error message states that the problem may stem from incorrect permissions or the parent directory being read-only  &#8211; the full message is:</p>
<blockquote style="font-size: 16px; font-style: normal; padding: 12px 16px; border: 1px solid #dcdede; border-radius: .5rem; background: #efefef;"><p>The IDE cannot create the directory.<br />
Possible reason: parent directory is read-only or the user lacks the necessary permissions.</p>
<p>If you have modified the &#8216;idea.log.path&#8217; property, please make sure it is correct, otherwise, please re-install the IDE.</p>
<p>&#8212;&#8211;<br />
Location: /Users/&lt;username&gt;/Library/Logs/JetBrains/PhpStorm2031.3<br />
java.nio.file.AccessDeniedExpection: /Users/&lt;username&gt;/Library/Logs/JetBrains/PhpStorm2031.3</p></blockquote>
<h2>How to fix &#8220;the IDE cannot create the directory&#8221;</h2>
<p>After trying many suggestions on the Web, including reinstalling PhpStorm, I found that the really simple process of removing the log files completely resolved the problem. This works because it forces the initialisation process to recreate them, and, in doing so, it creates them with the correct permissions.</p>
<h3>Remove log files using the command line</h3>
<p>The easiest way to remove these files is using the following command, which will recursively remove the &#8220;Log&#8221; folder and all it&#8217;s content:</p>
<pre><code>$ rm -rf ~/Library/Logs/JetBrains</code></pre>
<h3>Removing log files using Finder</h3>
<p>If you&#8217;re not comfortable with the CLI then you can always use the Finder app to remove them by taking the following steps:</p>
<ol>
<li>Choose &#8220;Go&#8221; from Finder&#8217;s menu options</li>
<li>Enter the location from the error message, or the following, replacing <code>&lt;username&gt;</code> with your account:<br />
<code>/Users/&lt;username&gt;/Library/Logs</code></li>
<li>Delete the JetBrains folder</li>
</ol>
<h2>This solution didn&#8217;t work for you?</h2>
<p>After a lot of research that all fell short of a solution, the process above of removing the log files, fixed the problem for me, on more than one occasion. However, it may be that, even though you&#8217;re getting the same error, your problem may not be the same as mine? So if this solution doesn&#8217;t work for you I&#8217;d strongly recommend you contact JetBrains technical support, or you carry out some more research and try some of the other fixes that have helped others.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/how-to-fix-the-phpstorm-error-the-ide-cannot-create-the-directory-in-under-a-minute/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2571</post-id>	</item>
		<item>
		<title>How to make position sticky work in Safari</title>
		<link>https://inthedigital.co.uk/how-to-make-position-sticky-work-in-safari/</link>
					<comments>https://inthedigital.co.uk/how-to-make-position-sticky-work-in-safari/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Sat, 24 Jul 2021 11:34:10 +0000</pubDate>
				<category><![CDATA[Dev Tricks]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2490</guid>

					<description><![CDATA[To make position sticky work in Safari make the sticky element a block and make a parent relative.]]></description>
										<content:encoded><![CDATA[<p>TLDR; This is how to make position sticky work in Safari:</p>
<blockquote><p>Make the sticky element a block and make a parent relative.</p></blockquote>
<pre><code class="language-xml">&lt;section style=&quot;display: relative&quot;&gt;
  &lt;div style=&quot;position: sticky; top: 150px; background: pink;&quot;&gt;
    I&#039;m sticky
  &lt;/div&gt;
  &lt;div style=&quot;padding-bottom: 100vh&quot;&gt;
    some content...
  &lt;/div&gt;
  &lt;span style=&quot;position: sticky; top: 150px; display: block; background: darkcyan;&quot;&gt;
      Me too!
  &lt;/span&gt;
  &lt;div style=&quot;padding-bottom: 100vh&quot;&gt;
    some more content...
  &lt;/div&gt;
&lt;/section&gt;</code></pre>
<h2>Here&#8217;s how to make position sticky work on Safari and Safari mobile</h2>
<p>Follow this simple checklist:</p>
<ol>
<li>Add <code>position : sticky</code> to the element that&#8217;s going to be sticky.</li>
<li>Add <code>top: 100px</code> to the sticky element. This is the offset top of whatever you need it to be.</li>
<li>Add <code>display: block</code> to the sticky element. <code>flex</code> and <code>grid</code> should work, too. *This is where Safari trips up, as <code>inline</code> or <code>inline-*</code> will not work.*</li>
<li>Add <code>position: relative</code> to the parent (or ancestor) element that&#8217;s the sticky element is to stay within.</li>
<li>Enjoy sticky elements.</li>
</ol>
<p>That&#8217;s it, but if you need more help, please <a href="https://inthedigital.co.uk/contact-us/">get in touch.</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/how-to-make-position-sticky-work-in-safari/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2490</post-id>	</item>
		<item>
		<title>How to create a Live Template in PHPStorm and WebStorm</title>
		<link>https://inthedigital.co.uk/how-to-create-a-live-template-in-phpstorm-and-webstorm/</link>
					<comments>https://inthedigital.co.uk/how-to-create-a-live-template-in-phpstorm-and-webstorm/#respond</comments>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Wed, 11 Nov 2020 22:08:52 +0000</pubDate>
				<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[Live Templates]]></category>
		<category><![CDATA[PHPStorm]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2387</guid>

					<description><![CDATA[<img width="300" height="147" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-creating-a-live-template-1.png?fit=300%2C147&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="PHPStorm using a Live Template to insert a PHP code block" style="float: none; margin: auto;" decoding="async" loading="lazy" />Use Live Templates to create custom code snippets that you can quickly insert into your code by typing a custom abbreviation. This is extremely handy for commonly used code blocks, such as the echo statement in php or inserting a php block into html. In this example I&#8217;ll demonstrate how to create a php block [&#8230;]]]></description>
										<content:encoded><![CDATA[<img width="300" height="147" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-creating-a-live-template-1.png?fit=300%2C147&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="PHPStorm using a Live Template to insert a PHP code block" style="float: none; margin: auto;" decoding="async" loading="lazy" /><p>Use Live Templates to create custom code snippets that you can quickly insert into your code by typing a custom abbreviation. This is extremely handy for commonly used code blocks, such as the <code>echo</code> statement in <code>php</code> or inserting a <code>php</code> block into <code>html</code>.</p>
<p>In this example I&#8217;ll demonstrate how to create a <code>php</code> block (<code>&lt;?php ?&gt;</code>) with the cursor moved into the block, ready for the <code>php</code> code. The trigger for the Live Template will be <kbd>ppp</kbd>.</p>
<h2>A Live Template to insert a PHP block</h2>
<p>Note that this walkthrough is for <a href="https://www.jetbrains.com/phpstorm/" target="_blank" rel="noopener noreferrer nofollow">PHPStorm</a>, but the process should be the same or very similar for many of the <a href="https://www.jetbrains.com" target="_blank" rel="noopener noreferrer nofollow">JetBrains</a> editors, such as <a href="https://www.jetbrains.com/webstorm/" target="_blank" rel="noopener noreferrer nofollow">WebStorm</a> and <a href="https://www.jetbrains.com/idea/" target="_blank" rel="noopener noreferrer nofollow">IntelliJ</a>.</p>
<ol>
<li>Open the editor and click <kbd>CMD</kbd> + <kbd>,</kbd> to open the IDE&#8217;s preferences.</li>
<li>Navigate to Live Templates &gt; HMTL/XML:<br />
<img loading="lazy" decoding="async" class="size-large wp-image-2392 alignnone" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-preferences.png?resize=1024%2C723&#038;ssl=1" alt="PHPStorm Live Template preferences" width="1024" height="723" srcset="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-preferences.png?resize=1024%2C723&amp;ssl=1 1024w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-preferences.png?resize=300%2C212&amp;ssl=1 300w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-preferences.png?resize=768%2C543&amp;ssl=1 768w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-preferences.png?resize=1536%2C1085&amp;ssl=1 1536w, https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-preferences.png?w=2044&amp;ssl=1 2044w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></li>
<li>Click the &#8216;+&#8217; icon in the right pane to add a new template (option 1 if prompted).</li>
<li>Give the new template an abbreviation (the trigger text) and a description:<br />
<img loading="lazy" decoding="async" class="alignnone size-large wp-image-2394" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-creating-php-block.png?resize=1024%2C723&#038;ssl=1" alt="PHPStorm creating a Live Template for a PHP block" width="1024" height="723" srcset="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-creating-php-block.png?resize=1024%2C723&amp;ssl=1 1024w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-creating-php-block.png?resize=300%2C212&amp;ssl=1 300w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-creating-php-block.png?resize=768%2C543&amp;ssl=1 768w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-creating-php-block.png?resize=1536%2C1085&amp;ssl=1 1536w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-creating-php-block.png?w=2044&amp;ssl=1 2044w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></li>
<li>Add the template text. In this case, we want to create a <code>php</code> block in an <code>html</code> file and move the cursor to inside the code block, which is achieved using the IDE parameter <code>$SELECTION$</code>:<br />
<img loading="lazy" decoding="async" class="alignnone size-large wp-image-2395" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-adding-the-code-block.png?resize=1024%2C723&#038;ssl=1" alt="PHPStorm creating a Live Template for a PHP code block" width="1024" height="723" srcset="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-adding-the-code-block.png?resize=1024%2C723&amp;ssl=1 1024w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-adding-the-code-block.png?resize=300%2C212&amp;ssl=1 300w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-adding-the-code-block.png?resize=768%2C543&amp;ssl=1 768w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-adding-the-code-block.png?resize=1536%2C1085&amp;ssl=1 1536w, https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-adding-the-code-block.png?w=2044&amp;ssl=1 2044w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></li>
<li>Set the application context to &#8216;HTML Text&#8217; and click &#8216;Apply&#8217; to add the new live template:<br />
<img loading="lazy" decoding="async" class="alignnone size-large wp-image-2396" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-setting-the-contexts.png?resize=1024%2C723&#038;ssl=1" alt="PHPStorm creating a Live Template for a PHP code block, assigning its context to 'HTML Text'" width="1024" height="723" srcset="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-setting-the-contexts.png?resize=1024%2C723&amp;ssl=1 1024w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-setting-the-contexts.png?resize=300%2C212&amp;ssl=1 300w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-setting-the-contexts.png?resize=768%2C543&amp;ssl=1 768w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-setting-the-contexts.png?resize=1536%2C1085&amp;ssl=1 1536w, https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-setting-the-contexts.png?w=2044&amp;ssl=1 2044w" sizes="(max-width: 1000px) 100vw, 1000px" data-recalc-dims="1" /></li>
<li>Finally, use your new live template by typing <code>ppp</code> and hitting <kbd>enter</kbd>:<br />
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-2399" src="https://i2.wp.com/inthedigital.co.uk/wp-content/uploads/2020/11/phpstorm-live-template-demo-compressed.gif?resize=1014%2C612&#038;ssl=1" alt="PHPStorm using a Live Template to insert a PHP code block" width="1014" height="612" data-recalc-dims="1" /></li>
</ol>
<h2>Conclusion</h2>
<p>Writing simple Live Templates like the one above dramatically reduces the time spent on tiny, but regular tasks.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://inthedigital.co.uk/how-to-create-a-live-template-in-phpstorm-and-webstorm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2387</post-id>	</item>
		<item>
		<title>How to Move a Meta Box in WordPress</title>
		<link>https://inthedigital.co.uk/how-to-move-a-meta-box-in-wordpress/</link>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Sun, 02 Aug 2020 19:40:08 +0000</pubDate>
				<category><![CDATA[WordPress development]]></category>
		<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[Meta box]]></category>
		<category><![CDATA[Re-odering meta boxes]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=2031</guid>

					<description><![CDATA[<img width="300" height="146" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/08/move-a-meta-box.png?fit=300%2C146&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="How to move a WordPress meta box" style="float: none; margin: auto;" decoding="async" loading="lazy" />Sometimes you want to programmatically move a WordPress meta box to a more ideal position on the editor screen. Here's my way, with code.]]></description>
										<content:encoded><![CDATA[<img width="300" height="146" src="https://i1.wp.com/inthedigital.co.uk/wp-content/uploads/2020/08/move-a-meta-box.png?fit=300%2C146&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="How to move a WordPress meta box" style="float: none; margin: auto;" decoding="async" loading="lazy" /><p>Have you ever needed to programmatically move a meta box in the WordPress editor screen? Maybe you&#8217;ve needed to change its priority or position? I know I have, many times.</p>
<p>Recently, I needed to move a meta box to the top of the editor screen, just under the main editor (in &#8216;classic editor&#8217; mode) and all the usual suspects had no answers. So here&#8217;s my solution, which I think is pretty robust.</p>
<h2>Using the &#8216;edit_form_after_title&#8217; hook</h2>
<p>This hook is the perfect just-in-time point to jump in and update the <code>$wp_meta_boxes</code> global variable. I&#8217;m using it in conjunction with <code>$current_screen</code> to ascertain the current admin screen, then I&#8217;m looking through the &#8216;high&#8217; meta boxes and removing the one I&#8217;m looking for. Why? Because it can then be prepended to the array, forcing it to be the first of the &#8216;high&#8217; meta boxes.</p>
<h2>Here&#8217;s the code to move a meta box titled &#8216;PriceList&#8217; to the top</h2>
<p>NB: the action hook, <code>edit_form_after_title</code>, has one parameter; the <code>WP_Post</code> object, but it&#8217;s not needed in this instance.</p>
<pre><code class="language-php">/**
 * Move the &#039;pricelist&#039; meta box to top of the &#039;high&#039; area of the editor screen
 */
add_action(&#039;edit_form_after_title&#039;, function () {
    global $current_screen, $wp_meta_boxes;

    // only do stuff if this is the editor screen for the post type &#039;project&#039; and it has meta boxes
    if ($current_screen-&gt;id === &#039;project&#039; &amp;&amp; isset($wp_meta_boxes[&#039;project&#039;])) {

        // loop though &#039;high&#039; meta boxes
        foreach ($wp_meta_boxes[&#039;project&#039;][&#039;normal&#039;][&#039;high&#039;] as $key =&gt; $high_box) {

            // do stuff if the meta box with the title &#039;PriceList&#039; is found
            if ($high_box[&#039;title&#039;] === &#039;PriceList&#039;) {
                // grab the meta box
                $meta_box = [$key =&gt; $high_box];

                // remove it from the array of &#039;high&#039; meta boxes
                unset($wp_meta_boxes[&#039;project&#039;][&#039;normal&#039;][&#039;high&#039;][$key]);

                // add it to the start of the array
                $wp_meta_boxes[&#039;project&#039;][&#039;normal&#039;][&#039;high&#039;] = $meta_box + $wp_meta_boxes[&#039;project&#039;][&#039;normal&#039;][&#039;high&#039;];
            }
        }
    }
}, 100);</code></pre>
<p>As can be seen from the code above, the target meta box will now be the first one in the array, as required.</p>
<h2>Are there other ways to move meta boxes?</h2>
<p>As with most things in life the answer&#8217;s <em>yes! </em>You could manually move them by dragging them to the desired position, but this is a per-user setting, so not ideal if you want to set the default layout for all users. You could use <code>&lt;a href=&quot;https://developer.wordpress.org/reference/functions/do_meta_boxes/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;do_meta_boxes()&lt;/a&gt;</code> and <code>&lt;a href=&quot;https://developer.wordpress.org/reference/functions/remove_meta_box/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;remove_meta_box()&lt;/a&gt;</code> to remove the target meta box, then add it back where required, using <code>&lt;a href=&quot;https://developer.wordpress.org/reference/functions/add_meta_box/&quot; target=&quot;_blank&quot; rel=&quot;noopener noreferrer&quot;&gt;add_meta_box()&lt;/a&gt;</code> You can even use custom hooks provided by plugins, where they&#8217;re available, which is what I used to <a href="https://inthedigital.co.uk/501-2/">move the Yoast meta box to the bottom of the screen</a>.</p>
<h2>Need help with technical WordPress challenges?</h2>
<p>If you&#8217;d like help with WordPress please <a href="https://inthedigital.co.uk/contact-us/">get in touch and we can discuss your particular challenge</a>.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2031</post-id>	</item>
		<item>
		<title>Use the hover media query to detect mobile devices</title>
		<link>https://inthedigital.co.uk/detecting-mobile-devices-using-the-css4-hover-media-query/</link>
		
		<dc:creator><![CDATA[Mervyn Booth]]></dc:creator>
		<pubDate>Mon, 13 Apr 2020 10:30:08 +0000</pubDate>
				<category><![CDATA[Dev Tricks]]></category>
		<category><![CDATA[Mobile friendly]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS accessibility]]></category>
		<category><![CDATA[CSS magic]]></category>
		<guid isPermaLink="false">https://inthedigital.co.uk/?p=1962</guid>

					<description><![CDATA[<img width="300" height="256" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/04/media-query-hover.jpg?fit=300%2C256&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Detecting mobile devices using CSS media query hover" style="float: none; margin: auto;" decoding="async" loading="lazy" />Have you needed to apply styling to only touch devices, or only non-touch devices? Well, great news, the hover media query can ease your woes.]]></description>
										<content:encoded><![CDATA[<img width="300" height="256" src="https://i0.wp.com/inthedigital.co.uk/wp-content/uploads/2020/04/media-query-hover.jpg?fit=300%2C256&amp;ssl=1" class="attachment-medium size-medium wp-post-image" alt="Detecting mobile devices using CSS media query hover" style="float: none; margin: auto;" decoding="async" loading="lazy" /><p>Have you needed to apply styling to only touch devices, or only non-touch devices? Well, great news CSS4&#8217;s <code>@media (hover: [value])</code> can come to the rescue in a multitude of ways.</p>
<h2>What is CSS4?</h2>
<p>For some time we&#8217;ve been working with CSS3, which I think is pretty epic, especially when compared to <a href="https://www.w3.org/TR/CSS2/" target="_blank" rel="noopener noreferrer nofollow">what came before</a>. And CSS4 goes much further, offering super useful functionality to enhance how we interact with webpages. But, for now, we&#8217;re only focusing on the media query above, that, for me, is a breath of fresh air, as it vastly simplifies scenarios where I only want to target devices that have specific ways of interacting with the. e.g a touch-only device.</p>
<h2>Use-cases for the hover media query</h2>
<p>Here are two use-cases to whet the appetite, hopefully, they&#8217;ll show the power and flexibility of this awesome new media query?!</p>
<h3>Use Case 1: increase spacing between tap targets on touch devices</h3>
<p>I&#8217;ve had this one a few times, where the links are considered too close, thus reporting accessibility issues. The solution is to give each link (tap target) more spacing on touch devices. In this use case, I&#8217;m also using the media query <code>pointer</code> to detect the type of pointer (<code>none|coarse|fine</code>) &#8211; a perfect use-case for the hover media query:</p>
<pre><code class="language-css">@media (hover: none) and (pointer: coarse) {
  .nav-link {
    margin: $nav-link-margin--touch-only;
  }
}</code></pre>
<h3>Use Case 2: hover effects for devices with hover capability</h3>
<p>I was recently building a website where the creative direction required a simple animation that zoomed in on images when hovered over. This featured is intended only for devices that support hover (i.e. mouseover, etc). Here&#8217;s a code snippet that increases the <code>scale</code> of the image element when its parent is in a hovered state :</p>
<pre><code class="language-css">@media (hover: hover) {
  .image-wrap {
    overflow: hidden;

    &gt; img {
      transform: scale(1);
      transition: 0.25s ease-in transform;
    }

    &amp;:hover &gt; img {
      transform: scale(1.15);
      transition: 2.5s ease-out transform;
    }
  }
}</code></pre>
<p>As I&#8217;ve shown in the two use cases, this is a pretty useful media query and one I will be making a lot of use of. I&#8217;m also sure it can be used in conjunction with <a href="https://inthedigital.co.uk/nesting-css-media-queries/">nest media queries</a>? There is, however, one caveat; there is no support for Internet Explorer and Opera Mobile. But I no longer support IE, unless the client explicitly needs it and frankly cannot support the insanely restrictive Opera Mobile browser (unless the client needs it).</p>
<p>So, there it is, the awesome <code>hover</code> media query in CSS4. Enjoy using it!</p>
<h2>Do you have uses for hover media query?</h2>
<p>If you&#8217;ve got another use-case for this query, or you&#8217;d like help implementing it on your sites&#8217; then <a href="https://inthedigital.co.uk/contact-us/">please get in touch</a> as we&#8217;d love to help make use of this great CSS feature.</p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1962</post-id>	</item>
	</channel>
</rss>
