jQuery(document).ready(function( $ ){
$("#selector > img").wrap($('<a>',{
href: 'https://yourdomain.com'
}));
});
Month: September 2021
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>";