WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: WordPress Popular Post] Plugin Causing jQuery Plugin Not To Work (3 posts)

  1. GiveMore.com
    Member
    Posted 1 year ago #

    The WordPress Popular Post Plugin is breaking my custom jQuery popup plugin causing it to throw a TypeError saying the jQuery plugin call is not a function.

    The error will only happen if...
    1. You are on a single post page (the error does not occur at the category level)
    2. You are not logged into the backend

    I am pretty sure the error is being caused by lines 694 - 700 of file wordpress-popular-post.php, but do not know how to correct it and would prefer not to edit the plugin code for the sake of update ability.

    <!-- WordPress Popular Posts v<?php echo $this->version; ?> -->
    <script type="text/javascript">
        /* <![CDATA[ */
    	jQuery.post('<?php echo admin_url('admin-ajax.php'); ?>', {action: 'wpp_update', token: '<?php echo $nonce; ?>', id: <?php echo $id; ?>}, function(data){/*alert(data);*/});
        /* ]]> */
    </script>
    <!-- End WordPress Popular Posts v<?php echo $this->version; ?> -->

    The plugin looks to be working perfectly otherwise ... it is just causing my jQuery plugin to break.

    Can someone please help?

    You can see a live example here: http://blog2.givemore.com/pickford-on-give-take/

    Thanks!
    Joe

  2. GiveMore.com
    Member
    Posted 1 year ago #

    I changed the site directory and the example link is now at: http://www.givemore.com/blog/pickford-on-give-take/

    Anyone have any ideas how to help?

  3. GiveMore.com
    Member
    Posted 1 year ago #

    I solved it!

    The issue is that WordPress Popuplar Posts is importing jquery on line 683 using:

    wp_print_scripts('jquery');

    That was conflicting with my plugin because I already have jQuery importing in the head of every page.

    They were also two different versions of jQuery ... The plugin(wordpress) imported version 1.7.2 and I manually have been importing version 1.8.

    Hope this helps someone out there.

    The WordPress Popular Posts developer Hector Cabrera should update his plugin to check it jQuery is already imported and if so not import.

    Thanks!
    Joe

Topic Closed

This topic has been closed to new replies.

About this Topic