Horizontal scroller with post_thumbnail’s
I did it on a few sites. An example is below. If you want the jQuery code for it, I can give it you. It is a list of post thumbnails with their post titles shown below them. paragonhondainfo.com
I did it on a few sites. An example is below. If you want the jQuery code for it, I can give it you. It is a list of post thumbnails with their post titles shown below them. paragonhondainfo.com
Any Theme developer that dequeues core-bundled jQuery in order to enqueue some other version – any other version, bundled, CDN, etc. – is _doing_it_wrong(), period. Core, active Theme, and active Plugins all rely on a known version of jQuery being available. What to do about it? Tell the Theme developer that he’s _doing_it_wrong(), and ask … Read more
Thanks to Douglas.Sesar for pointing me in the right direction. Much appreciated! This is what I did… First put the following id in the title heading of the plugin. I am adding the admin message html (via jQuery) directly after this heading. <h1 id=”my-admin-message”>My Plugin Title</h1> My jQuery function: function fnDisplayAdminMessage(adminMessage, adminMessageColor) { jQuery.ajax({ type: … Read more
You have your jQuery hooked too early. The jQuery library has not yet loaded when the load-(page) action is fired. Use admin_print_scripts to print inline scripts. That action comes after scripts are enqueued. Here’s your original code using admin_print_scripts: add_action( ‘admin_print_scripts’, function () { $status = “status-started”; if($status == ‘status-started’): ?> <script> jQuery(document).ready(function($) { /* … Read more
The block editor is restoring back the title that was last saved (or typed manually into the textarea), so with the block editor, you can change the title dynamically using this code: wp.data.dispatch( ‘core/editor’ ).editPost( { title: ‘Title here’ } ) PS: You should make sure your JS file has the wp-editor, wp-edit-post or wp-data … Read more
I had this problem with a multisite setup. On my secondary site load-scripts.php returned a 404 error. the following line in wp-config.php fixed it for me: define( ‘CONCATENATE_SCRIPTS’, false ); # worked for me my .htaccess file: # BEGIN manual WordPress Multisite # The directives (lines) between `BEGIN WordPress` and `END WordPress` are # dynamically … Read more
Put those add_action functions in your functions.php file too. If they’re in header.php, WordPress never registers them since header isn’t loaded in AJAX. Also, you don’t need that is_admin() check. The theme’s header will never load in admin. So, your functions file should look like this: add_action(‘wp_ajax_my_special_action’, ‘my_action_callback’); add_action(‘wp_ajax_nopriv_my_special_action’, ‘my_action_callback’); function my_action_callback() { $whatever = … Read more
Get rid of the plugin/theme that’s causing jQuery to load 🙂 jQuery is shipped with WordPress doesn’t mean that it’s loaded every time by default, it’s being loaded by a theme or plugin that you’re using. Look for a call to wp_enqueue_script 🙂 Good luck!
Use conditional is_page() for loading script on specific page. Here Is The Modified Version of Your Function: //Load Scripts function load_scripts(){ wp_deregister_script(‘jquery’); // De-register Existing jquery wp_register_script(‘jquery’, ‘http://code.jquery.com/jquery.js’, ”, ”, true); wp_enqueue_script( ‘jquery’ ); wp_register_script(‘bootstrap-jquery’,get_template_directory_uri().’/assets/js/bootstrap.js’, array( ‘jquery’ ), ”, true); wp_enqueue_script( ‘bootstrap-jquery’ ); // register the script wp_register_script( ‘my-script’, ‘URL to Script’ ); // by … Read more
Hook to wp_enqueue_scripts. It will do the trick. Modified code is- if (!function_exists(‘modify_jquery’)) { function modify_jquery() { if (is_page(array(‘page 1’, ‘page 2’))) { wp_dequeue_script(‘jquery’); wp_deregister_script(‘jquery’); wp_register_script(‘jquery-custom’, ‘//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js’, false, ‘1.11.3’, ‘true’); wp_enqueue_script(‘jquery-custom’); } } } // add_action(‘init’, ‘modify_jquery’); add_action(‘wp_enqueue_scripts’, ‘modify_jquery’); Hope this is gonna help.