How to add custom JavaScript for Content Views (free) version?

Sometimes, you want to add custom JavaScript for Content Views output.

With Content Views Pro version, there is a Custom JS field in Content Views >> Settings page where you can add custom JavaScript easily.

With Content Views Free version, you can install another plugin to add custom JavaScript.

To do it without installing plugin, you can add this code to file functions.php of your active theme:

// Content Views - add custom script
add_action( 'wp_footer', 'cv_theme_custom_script', 999999 );
function cv_theme_custom_script() {
	?>
	<script>
		jQuery( document ).ready( function ( $ ) {
			// ADD YOUR CUSTOM SCRIPT HERE
		} );
	</script>
	<?php
}

Notice:
If you are using any cache plugin, please clear the cache data after adding above code.

Best regards,

Scroll to Top