wp_enqueue_scripts hook is not being called

Your code is correct, though I would not add the callback if the function name has already been used. If someone else has used the name you don’t know what you might be adding. if(!function_exists(‘bi_frontend_scripts’)) { function bi_frontend_scripts() { wp_enqueue_script(‘jquery’); // I originally wanted to do: wp_enqueue_script(‘jQuery.bxSlider’, get_bloginfo(‘template_url’).’/scripts/jquery.bxslider/jquery.bxslider.min.js’, array(‘jquery’)); } add_action(‘wp_enqueue_scripts’, ‘bi_frontend_scripts’); } I also … Read more

Why are my frontend theme styles bleeding into the backend?

You’re supposed to enqueue on the wp_enqueue_scripts event. Placing the function in functions.php and immediately running it, will make it run on all pages, including the admin area Here’s an example from the devhub: /** * Proper way to enqueue scripts and styles. */ function wpdocs_theme_name_scripts() { wp_enqueue_style( ‘style-name’, get_stylesheet_uri() ); wp_enqueue_script( ‘script-name’, get_template_directory_uri() . … Read more

Frontend Post Form Validation

The best way to do form validation is with a combination of JavaScript and PHP. The reason why you want to perform JavaScript validation is to give the users a chance to correct their errors without submitting the form. Plus, it will stop any casual mistakes. You will also want to ensure validation on the … Read more

Uploading avatar from the frontend

You only need to of these hooks show_user_profile to show the extra fields and personal_options_update to update, try: <?php ob_start(); include_once(“../../../wp-load.php”); get_header(); /* Get user info. */ global $current_user, $wp_roles; get_currentuserinfo(); /* Load the registration file. */ require_once( ABSPATH . WPINC . ‘/registration.php’ ); /* If profile was saved, update profile. */ if ( ‘POST’ … Read more

How to attach a uploaded video to post from front end

You could use wp_insert_attachment to upload a video file into the media library and then attatch it to the newly created post. See http://codex.wordpress.org/Function_Reference/wp_insert_attachment But it would be wise to have a few conditional statements in place to at least check for video size and type otherwise your site would be open to abuse.

Handling jQuery Component Collision

My suggestion would be to use a mix of code isolation in an anonymous function and checking if jquery is already present. Here’s an example: (function() { var jQuery; // your jquery variable // check if jquery is present and if it has the version you want if (window.jQuery === undefined || window.jQuery.fn.jquery !== ‘1.8.3’) … Read more