Windows scaling issues for high-DPI devices: Adobe Photoshop & Illustrator
If you have recently bought a 4k monitor, you may have noticed...
24.Jun.2017 | Code Snippets, Wordpress
A quick way to remove empty p tags from custom shortcodes in WordPress.
<?php
add_filter("the_content", "the_content_filter");
function the_content_filter($content) {
$block = join("|",array("shortcode1","shortcode2","shortcode3"));
$rep = preg_replace("/( <p> )?\[( $block )(\s[^\]]+)?\](<\/p>|<br \/>)?/", "[$2$3]", $content);
$rep = preg_replace("/( <p> )?\[\/( $block )](<\/p>|<br \/>)?/","[/$2]",$rep);
return $rep;
}
Credit: https://gist.github.com/bitfade
PHP, Wordpress Function, WordPress Tips
Share
If you have recently bought a 4k monitor, you may have noticed...
A quick snipped of code that can be used attach a function...
In the early days (2003), WordPress was essentially a blogging tool and...
Fed up of getting the W3 Validator warning "The type attribute is unnecessary..."? Here is a handy bit of code to...
I came across this when looking for a purpose built, fully customisable calendar - https://fullcalendar.io/ Im just starting to work with...
Handy bit of code you can use in your custom templates that grabs the all the page or post data by ID:...