/**
* Plugin Name: My Basics Plugin
* Plugin URI: https://example.com/plugins/the-basics/
* Description: Handle the basics with this plugin.
* Version: 1.10.3
* Requires at least: 5.2
* Requires PHP: 7.2
* Author: John Smith
* Author URI: https://author.example.com/
* License: GPL v2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Update URI: https://example.com/my-plugin/
* Text Domain: my-basics-plugin
* Domain Path: /languages
*/
Delay JavaScript Execution Revolution Slider Fix
ADD in the Delay JavaScript Execution field:
/jquery-?[0-9.]*(.min|.slim|.slim.min)?.js
/wp-includes/js/jquery/jquery-migrate.min.js
/plugins/revslider/public/assets/js/
setREVStartSize
rev_slider_
revslider_
Load JavaScript Deferred field, please enter the following exclusions:
/jquery-?[0-9.]*(.min|.slim|.slim.min)?.js
/wp-includes/js/jquery/jquery-migrate.min.js
Mac Disable adobe creative cloud start at login
//It is loaded by default by /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist.
//If you run
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
that will disable it for your user.
//To turn it back on
launchctl load -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
Mac Change Screenshot to JPG format
defaults write com.apple.screencapture type jpg
Allow the mac to install software from any developer
// Command to Allow the mac to install software from any developer
sudo spctl --master-disable
// Command to reset the setting to default
sudo spctl --master-enable
Typical Device Breakpoints
/* Extra small devices (phones, 600px and down) */
@media only screen and (max-width: 600px) {...}
/* Small devices (portrait tablets and large phones, 600px and up) */
@media only screen and (min-width: 600px) {...}
/* Medium devices (landscape tablets, 768px and up) */
@media only screen and (min-width: 768px) {...}
/* Large devices (laptops/desktops, 992px and up) */
@media only screen and (min-width: 992px) {...}
/* Extra large devices (large laptops and desktops, 1200px and up) */
@media only screen and (min-width: 1200px) {...}
Wrap element by jQuery
jQuery(document).ready(function( $ ){
$("#selector > img").wrap($('<a>',{
href: 'https://yourdomain.com'
}));
});
How To Remove The Divi Blog Module Meta Separators
Blog module settings>Advanced tab>CSS IDs & Classes and add “pa-remove-meta-separators” to the CSS Class input field.
<script>
//Remove meta seperator pipes (|) and by from Divi Blog module meta
jQuery(function($) {
$(document).ready(function() {
$('.pa-remove-meta-separators .post-meta').each(function() {
$(this).html($(this).html().replace(/\|/g, " "));
$(this).html($(this).html().replace('by', " "));
$(this).html(jQuery(this).html().replace(/,/g, ""));
});
//Do the same for ajax with pagination enabled
$(document).bind('ready ajaxComplete', function() {
$('.pa-remove-meta-separators .post-meta').each(function() {
$(this).html($(this).html().replace(/\|/g, " "));
$(this).html($(this).html().replace('by', " "));
$(this).html(jQuery(this).html().replace(/,/g, ""));
});
});
});
});
</script>
Redirect to parent window
add_action( 'wp_footer', function () { ?>
<script>
jQuery( window ).on( "load", function() {
var ifrm = document.getElementById('ChildCareCRM');
//var base = doc.createElement("base");
ifrm.contentDocument.baseURI = document.baseURI;
//ifrm.contentDocument.querySelector("head").appendChild(base);
//var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
//iframeDoc.getElementById('form').setAttribute('target','_parent');
//jQuery( "#ChildCareCRM" ).contents().find( "#form" ).attr('target','_parent');
//console.log(jQuery( "#ChildCareCRM" ).contents().find( "form" ).attr('target'));
});
</script>
<?php }, 100 );
WordPress numbered pagination
echo "<nav class=\"sw-pagination\">";
$big = 999999999; // need an unlikely integer
echo paginate_links( array(
'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
'format' => '?paged=%#%',
'current' => max( 1, get_query_var('paged') ),
'total' => $loop->max_num_pages
) );
echo "</nav>";