WordPress.org

Support

Support » Plugins and Hacks » Hacks » Plugin not working

Plugin not working

  • hi
    i downloaded the plugin Alchemist Ajax Upload. to upload images from fronted.
    it works just fine when i use the shortcode [AAIU] in the backend site editor.
    but i want to use it in my theme code. but i cannot get the button to work it just links to #.
    i have got the plugin to show in the theme using the code
    <?php echo do_shortcode(‘[AAIU]’);?>

    what could be the problem?

Viewing 6 replies - 1 through 6 (of 6 total)
  • I’m guessing that there is a Javascript error in the theme or one of the plugins preventing the button from working.

    Check in the Browser’s console log to see any errors.

    Got a URL to the site ?

    Where did you download the plugin from?

    ianhaycox
    it does not make any sense that it should be a plugin because it works when i insert in the correct site from the site editor.

    but it stops working when i want to insert it in the correct place, with the echo. in the theme code.

    krishna
    i downloadet it from official wordpress. 🙂

    Moderator bcworkz

    @bcworkz

    Linking to # is normal for submit buttons that rely on javascript events to run instead of having the browser submit the form. This plugin politely will not enqueue its scripts unless it “sees” that its shortcode is in the post content. Since it cannot “see” itself in a do_shortcode() call, no scripts are loaded and nothing works.

    You could extend the conditions under which the scripts load by modifying line 66 of the main plugin file, but your change would need to be reapplied each time the plugin is updated. With upload plugins, it is critical you apply updates ASAP.

    how do i extend the conditions?

    Moderator bcworkz

    @bcworkz

    Depends on where you need the scripts loaded. Perhaps use one of the various is_*() template tags like is_home() or is_archive() etc. Link the required conditions inside the parenthesis after ‘if’ with the double bar OR operator: ||. Something like this:
    if ($this->has_shortcode('AAIU') || is_home()) {

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Plugin not working’ is closed to new replies.
Skip to toolbar