Andrew Briggs
Andrew Briggs

Reputation: 1349

How to insert Revolution Slider manually using Javascript

I am inserting the revolution slider using a shortcode on the WordPress page in the page editor:

[rev_slider test]

However, when the page is published, the revolution slider is not showing and Chrome console shows javascript error. When I view source, Wordpress wraps

tags around the revolution slider javascript code.

Is there a way to manually add a revolution slider to a WordPress page using javascript such as:

revSlider.load('slideContainer', 'test');

So far I have not found any way to inject or insert the javascript code for a revolution slider into a WordPress page.

Upvotes: 0

Views: 1502

Answers (1)

Poldira
Poldira

Reputation: 183

I'm assuming that it's wrapping the entire thing in <p> tags?

To avoid this, add the following to your functions.php:

add_filter( 'the_content', 'shortcode_unautop',100 );

Used with the following to make sure it's not wrapping all your content:

remove_filter( 'the_content', 'wpautop' );

If that still doesn't help, there's a PHP solution here: How to Add a Slider without A Shortcode or Widget

Upvotes: 0

Related Questions