Getting Call to undefined function add_shortcode() for refreshing a div
-
I need to refresh a div every 10 seconds. The content of the div is a shortcode, which has an image from an array.
The div name is header_image and the code to create shortcode is present in functions.php
So added this code to functions.php
<script src="https://code.jquery.com/jquery-latest.js"></script> <script> $(document).ready(function(){ setInterval(function() { $(".header_image").load("the complete url"); }, 1000); }); </script>
Then I got an error Call to undefined function add_shortcode()
So I added require_once( ABSPATH . ‘/wp-includes/shortcodes.php’ ); to functions.php
And now I am getting the errorFatal error: Call to undefined function add_filter();
Any help to solve the issue
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Getting Call to undefined function add_shortcode() for refreshing a div’ is closed to new replies.