Divi theme: Remove the link to each Portfolio item within Filterable Portfolio.
<?php
/**
* Divi theme: Remove the link to each Portfolio item within Filterable Portfolio.
*
* @link https://gist.github.com/cliffordp/e6dfd8c9533ae4b31d4c3b8ffb6dce8d This snippet.
*/
add_action( 'wp_footer', function () {
if ( ! class_exists( 'ET_Builder_Module_Filterable_Portfolio' ) ) {
return;
}
wp_enqueue_script( 'jquery' );
?>
<script>
jQuery( 'div.et_pb_portfolio_items' ).each( function () {
jQuery( this ).find( 'a' ).replaceWith(
function () {
return jQuery( this ).contents();
}
);
} );
</script>
<?php
} );