WordPress.org

Forums

Archives Calendar Widget
Nice one except a jQuery error. It is solved. (2 posts)

  1. muneer1st
    Member
    Posted 10 months ago #

    Thanks a lot for nice plugin.

    Anyway, there was an error for me 'ReferenceError: jQuery is not defined'. It could be based on my script structure. To overcome the issue, I just modified a line in file : archive-calendar.php @ function archivesCalendar_jquery_plugin() added dependency array to wp_register_script statement. The complete statement is below.

    function archivesCalendar_jquery_plugin()
    {
    	wp_register_script( 'archivesCW', plugins_url(). '/archives-calendar-widget/jquery.archivesCW.min.js',
                    array('jquery') );
    	wp_enqueue_script( 'archivesCW');
    }

    Everything fine.

    also I could be able to modify this plugin to work with different post types using different url pattern.

  2. alek
    Member
    Plugin Author

    Posted 10 months ago #

    Glad to hear it.

    Actually you had that error because the jQuery is not ncluded by default, you have to activate it in settings in case if your theme do not use it.

    I often use hardcoded jQuery link from Google API in my themes to increase loading time (already cached in many cases). Including the script with dependencies will include the jQuery script twice (WordPress' one and Google's one).
    So you can choose to include or not the WordPress' jQuery by setting this option("Include jQuery library" in the plugin settings).

Reply

You must log in to post.

About this Plugin

  • Archives Calendar Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.