Support Forum

Can't create polls

AA Andrew Adie
Andrew Adie
Member

When I edit a topic, and click on the Poll button to add a poll the button points to javascript:void(null) and nothing happens. Any ideas?

9 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

It usually (I stress usually) points to a javascript conflict in your site – your wp theme or another plugin – which needs to be fixed. This codex article explains what this means and what to look for:

http://codex.simple-press.com/codex/faq/troubleshooting/what-is-this-jquery-conflict/

If you give us a link to your forum page we can take a brief look however.

YS Yellow Swordfish
Yellow Swordfish
Member

Yes – as I suspected. Your WP theme is breaking the WordPress rules as outlined in the article I linked to above. Not only are they force loading their own jQuery library but it is also a woefully out of date version (1.4 as opposed to the proper 1.7).

I think you will find if you can correct this then things will work as expected.

AA Andrew Adie
Andrew Adie
Member

Thanks. I’ll look into updating it. Appreciate your help.

 

YS Yellow Swordfish
Yellow Swordfish
Member

Come back if you get into difficulties. We can sometimes help although it is always worth talking to the theme author first.

AA Andrew Adie
Andrew Adie
Member

Hi, the theme author says there will be no further updates. Is there another way I can work around this. The simple:press forums are working great apart from the polls…this is the bit i really need as it is to allow users to vote on bands that apply for our charity music festival. 

YS Yellow Swordfish
Yellow Swordfish
Member

How very helpful.
You will need to find where the jQuery.js file is being loaded. I would suggest that it is probably in the themes header.php so start woth that and take a look at the code. See if you can see a script tag loading that library.

AA Andrew Adie
Andrew Adie
Member

There was and I updated it to point to:

<script type=”text/javascript” src=”<?php bloginfo(‘template_directory’); ?>/includes/js/jquery-1.7.2.min.js”></script>

It all seems to work now….thanks for your help :)

YS Yellow Swordfish
Yellow Swordfish
Member

Well yes that IS better but I am afraid it is still not actually correct! Scripts in WP should not really be loaded using the script tag at all.

What you should do is remove that line of code completely from the header.php then open up the themes functions.php and add this:

add_action('wp_enqueue_scripts', 'load_script', 1);
function load_script() {
    wp_enqueue_script('jquery');
}

You can change the function name of course.