Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Media file search issue › Reply To: Media file search issue
November 30, 2023 at 11:28 am
#46253
Keymaster
Well, it should not be too difficult, but you need a lightbox script. I found a ready made test solution in a previous thread:
add_action('wp_footer', 'asp_custom_footer_script', 99999);
function asp_custom_footer_script() {
?>
<style>
.asp_r {
z-index: 10 !important;
}
</style>
<script>
var s = document.createElement( 'script' );
s.setAttribute( 'src', 'https://unpkg.com/[email protected]/dist/simple-lightbox.js' );
document.body.appendChild( s );
s = document.createElement( 'link' );
s.setAttribute( 'rel', 'stylesheet' );
s.setAttribute( 'href', 'https://unpkg.com/[email protected]/dist/simple-lightbox.css' );
document.body.appendChild( s );
jQuery(function($){
$('.asp_m').on('asp_results_show', function(){
new SimpleLightbox('.asp_r .item a', { /* options */ });
});
});
</script>
<?php
}
Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.
Please keep in mind, that this is a test code only, the files should be self-hosted and some other checks may be required.
Unfortunately I am not available for custom jobs, I am sorry.