Interactive maps in wordpress
Interactive maps in wordpress
Interactive maps in wordpress
Your scripts and styles all share the same handle, “fancybox”, which should be unique, and I think that’s your issue. Try this: wp_register_script( ‘mousewheel’, get_stylesheet_directory_uri(‘/js/jquery.mousewheel-3.0.6.pack.js’, __FILE__), array(‘jquery’), ‘3.06’, true ); wp_register_script( ‘fancybox-script’, get_stylesheet_directory_uri(‘/js/jquery.fancybox.js’, __FILE__), array(‘jquery’), ‘1.0’, true ); wp_register_script( ‘fancybox-pack’, get_stylesheet_directory_uri(‘/js/jquery.fancybox.pack.js’, __FILE__), array(‘jquery’), ‘1.0’, true ); wp_register_script( ‘fancybox-buttons’, get_stylesheet_directory_uri(‘/js/jquery.fancybox-buttons.js’, __FILE__), array(‘jquery’), ‘1.0’, true ); wp_register_script( … Read more
Start by putting your JS in an appropriate .js file in your theme directory. Use the wp_enqueue_scripts hook (this is where you will enqueue/load any of your custom javascripts). Within that hook, use wp_enqueue_script() to load your script(s). Example: add_action( ‘wp_enqueue_scripts’, ‘enqueue_my_stuff’ ); function enqueue_my_stuff () { wp_enqueue_script(‘slug_for_your_script’ , get_template_directory_uri() . ‘/path/to/yourscripts.js’, array(‘jquery’) ); }
I’ve got it to show the variation name in a separate div on “hover”, but not yet on “click” as there seems to be a conflict somewhere with WooCommerce. First of all, place an empty div somewhere on the single product page in your child theme, I’m using /single-product/meta.php. My div looks like this: <div … Read more
If the script is there it should work. It’s probably failing because you’re not declaring the jquery dependency and you’re not wrapping it correctly (in no conflict mode). Here’s how your script should be enqueued: function custom_scripts() { wp_enqueue_script( ‘unique-custom-script’, get_stylesheet_directory_uri() . ‘/custom.js’, array(‘jquery’) , false, true ); } add_action( ‘wp_enqueue_scripts’, ‘custom_scripts’, 99 ); And … Read more
“[C]an you give me all options that are possible”? (emphasis added) No, because HTML, CSS, JS, PHP, and WordPress are powerful and sophisticated. Below are are some different approaches, however. [Affiliation: I am not affiliated with any plugins or programs listed here.] is_user_logged_in() In WP, the level closest to the code is to use the … Read more
Try this. You were missing the tags and the “type” attribute for the tag. The php tag at the bottom echo’s the result that was input in the textarea. Read this http://www.w3schools.com/html/html_forms.asp it should help you get started. <div class=”font-wrap”> <div class=”wrapper”> <form action=”” method=”post”> <textarea name=”comment” id=”comment” class=”talk-bubblecomment” tabindex=”4″ placeholder=”Enter comment…”></textarea> <p class=”sign-in”> Post … Read more
You forgot to set dependencies at third parameter put it with array() or array(‘jquery’) if you want to depend on jQuery wp_register_script( ‘navbar-scroll’, ‘http://www.classyclutter.net/wp-content/themes/foodiepro/assets/js/scrolling-navbar.js’, array(), ‘1.0.0’, true);
Problem was a simple misspelling. The add_action should be add_action (‘wp_enqueue_scripts’, ‘theme_add_cycle_slide’ ); I wrote ‘script’
Create a plugin that dequeues the javascript you don’t want, and enqueues the edited javascript. <?php /** * Plugin Name: Stackexchange Sample * Author: Nathan Johnson * Licence: GPL2+ * Licence URI: https://www.gnu.org/licenses/gpl-2.0.en.html * Domain Path: /languages * Text Domain: stackexchange-sample */ //* Don’t access this file directly defined( ‘ABSPATH’ ) or die(); add_action( ‘wp_enqueue_scripts’, … Read more