Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Luis

    (@chuo999)

    Hello, error found in firebug console:

    ReferenceError: ch_ctdn is not defined
    ch_ctdn(‘2591234’, ‘ch_widget-2042_1’);

    in this lines

    jQuery(document).ready(function() {
    ch_ctdn(‘2591234’, ‘ch_widget-2042_1’);
    });

    My shortcode is [contesthopper contest=”2042″]

    My theme is City Desk by Gabfire themes

    Installed plugins:

    Akismet

    Contact form 7

    Contact Form DB

    ContestHopper for WordPress

    Ninja Pages, Categories, and Tags

    PHP Text Widget

    Really Simple CAPTCHA

    Widget Logic

    WP Bannerize

    WP e-Commerce

    I tried the plugin in a fresh WP 3.8.1 installation and it works like a charm!!!

    https://www.gfserver.com.ve/demowp/concurso/

    Thanks to Carlos-Vazquez for the spanish translation and Webikon for creating this awesome plugin, but I′m stucked in my client’s page, help needed!

    Plugin Author Webikon s.r.o.

    (@webikon)

    Hello,
    thank you for the feedback.

    It seems that contesthopper front-end javascript and CSS is not loading on your page. From the plugin list I don’t see anything suspicious. Maybe the theme is causing that, but this is not straightforward to debug.

    You can try to work around this by manually adding
    CSS file (wp-content/plugins/contesthopper/templates/default/widget.css)
    and enqueue+localize ch_js_widget

    wp_enqueue_script('ch_js_widget');
    wp_localize_script('ch_js_widget', 'ch_ajax', array('ajaxurl' => admin_url('admin-ajax.php')));
    Thread Starter Luis

    (@chuo999)

    Hello Webikon, thanks very much for your answer.

    I added the css code into the default css theme file and now it looks OK, then I added the two lines of code you kindly indicated in the wp-includes/functions.wp-scripts.php file, but although now it shows the remaining days, it is still not working.

    function wp_register_script( $handle, $src, $deps = array(), $ver = false, $in_footer = false ) {
    global $wp_scripts;
    if ( ! is_a( $wp_scripts, ‘WP_Scripts’ ) ) {
    if ( ! did_action( ‘init’ ) )
    _doing_it_wrong( __FUNCTION__, sprintf( __( ‘Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.’ ),
    wp_enqueue_scripts‘, ‘admin_enqueue_scripts‘, ‘login_enqueue_scripts‘ ), ‘3.3’ );
    $wp_scripts = new WP_Scripts();
    }

    $wp_scripts->add( $handle, $src, $deps, $ver );
    if ( $in_footer )
    $wp_scripts->add_data( $handle, ‘group’, 1 );

    wp_enqueue_script(‘ch_js_widget’);
    }

    —————————

    function wp_localize_script( $handle, $object_name, $l10n ) {
    global $wp_scripts;
    if ( ! is_a( $wp_scripts, ‘WP_Scripts’ ) ) {
    if ( ! did_action( ‘init’ ) )
    _doing_it_wrong( __FUNCTION__, sprintf( __( ‘Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.’ ),
    wp_enqueue_scripts‘, ‘admin_enqueue_scripts‘, ‘login_enqueue_scripts‘ ), ‘3.3’ );

    return false;
    }

    return $wp_scripts->localize( $handle, $object_name, $l10n );

    wp_localize_script(‘ch_js_widget’, ‘ch_ajax’, array(‘ajaxurl’ => admin_url(‘admin-ajax.php’)));
    }

    Where should I add this code?

    Again…Thanks very very much!!

    I’m having the same issue. I have no idea how to do code.

    Is there any way you can help?

    https://steviclackphotography.com/blog/happy-birthday-to-us/

    Plugin Author Webikon s.r.o.

    (@webikon)

    chuo999,

    never ever edit core files. the two lines need to go to your theme functions.php, and have to be called in a hook

    https://codex.www.ads-software.com/Function_Reference/wp_enqueue_script
    https://codex.www.ads-software.com/Function_Reference/wp_localize_script

    Plugin Author Webikon s.r.o.

    (@webikon)

    steviphoto,

    you have a javascript error, probably because two jquery versions are called.
    is your theme a custom one?

    juraj

    Thread Starter Luis

    (@chuo999)

    Thanks very much!

    I added this to my theme’s functions.php file

    function theme_name_scripts() {

    wp_enqueue_script(‘ch_js_widget’);
    wp_localize_script(‘ch_js_widget’, ‘ch_ajax’, array(‘ajaxurl’ => admin_url(‘admin-ajax.php’)));
    }

    add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ );

    Now is working.. Thanks!

    Plugin Author Webikon s.r.o.

    (@webikon)

    no problem,
    now enjoy some contest hoppin’ ??

    Thread Starter Luis

    (@chuo999)

    Thanks for this great plugin and for your support!

    steviphoto

    (@steviphoto)

    Yes, my theme is custom.

    steviphoto

    (@steviphoto)

    Yes, my theme is custom.

    Plugin Author Webikon s.r.o.

    (@webikon)

    steviphoto,

    well, you need to make sure your theme uses the same jquery version that wordpress does. this is done easily with enqueue_script.

    https://codex.www.ads-software.com/Function_Reference/wp_enqueue_script

    since you say, you have no idea how to code, try to contact the person who created the template for you.

    cheers,

    juraj

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Not submintting form’ is closed to new replies.