How can i upload images in an admin page?

First of all edit_user_profile and show_user_profile action hooks don’t have to save the image, you can just add a field there. So function image_up_gall(){ ?> Select image to upload: <input type=”file” name=”fileToUpload” id=”fileToUpload”> <input type=”submit” value=”Upload Image” name=”submit”> <?php } add_action(‘edit_user_profile’, ‘image_up_gall’); add_action(‘show_user_profile’, ‘image_up_gall’); It is because WordPress has its own form tag already, just … Read more

How to use different assets if local or live

WordPress has constants that can be defined in the wp-config.php. Have a read here Something like this might help //setup the production names for the files $js_file=”scripts.min.js”; $css_file=”styles-compressed.css”; //check for WP_DEBUG constant status if( defined( ‘WP_DEBUG’ ) && WP_DEBUG ) { //check for SCRIPT_DEBUG constant status if( defined( ‘SCRIPT_DEBUG’ ) && SCRIPT_DEBUG ) { $js_file=”scripts.js”; … Read more

Make logo dynamic in wordpress

Theme header logo function get_theme_mod( ‘custom_logo’ ); $custom_logo_id = get_theme_mod( ‘custom_logo’ ); $image = wp_get_attachment_image_src( $custom_logo_id , ‘full’ ); echo ‘<img class=”header_logo” src=”‘.$image[0].'”>’;