Replace Woocommerce Images

Unfortunately, trying to pull a fast one on the WordPress media library with FTP won’t work. You’ll need to import them through the WP admin so they get added to the database, resized, and whatever other special sauce WP adds. I’ve never used it, but this plugin sounds like it might be right up your … Read more

Bulk edit wordpress images alt and title attributes

You can use the ‘wp_get_attachment_image_attributes’ hook add_filter( ‘wp_get_attachment_image_attributes’, ‘image_attributes’, 20, 2 ); function image_attributes( $attr, $attachment ) { // Get post parent $parent = get_post_field( ‘post_parent’, $attachment ); // Get post title $title = get_post_field( ‘post_title’, $parent ); if ( is_single( $parent ) ) { $attr[‘alt’]=$title; } return $attr; } Or Check Out my new … Read more

How might I retrieve a featured post image from an external WP site and display it as a link back?

Whenever I’m trying to link two sites, I find the most efficient and least destructive way is to use the WordPress XMLRPC API. http://codex.wordpress.org/XML-RPC_WordPress_API/Posts In this case, you could pull this info through using the built in IXR_Client library. This saves a ton of time writing code and trying to mix databases. If they wind … Read more

Way to force media uploader use custom image size

When calling add_filter( ‘image_size_names_choose’, ‘custom_image_sizes_choose’ ); use your investigative skills to see how it would be best to call an if(thisweretrue) add_filter( ‘image_size_names_choose’, ‘custom_image_sizes_choose’ ); since I don’t know exactly what your specific situation is. I actually was able to use your solution for setting up the custom sizes to help out with what I … Read more

Theme Customiser Image Control

The solution, needs a custom control object extending the original image control, and does an SQL query to grab the GUID and associated attachment ID on sanitisation. Not nice, kludgey, but it works $wp_customize->add_setting( ‘customimage’, array( ‘default’ => $default, ‘capability’ => ‘edit_theme_options’, ‘type’ => ‘option’, ‘sanitize_callback’ => array( ‘ICIT_Customize_Image_Control_AttID’, ‘attachment_guid_to_id’ ), ‘sanitize_js_callback’ => array( ‘ICIT_Customize_Image_Control_AttID’, … Read more

Display (and manage) webcam images?

Alright, here is code for having wordpress pages redraw an image on a page as new images are detected (like for a directory that a web cam automatically uploads images to). It assumes the following: You are using PHP 5.3 or higher (easily modified to not require it though) You have your web cam images … Read more

Custom post type Admin Page

1. The easiest way is to use the plugin “Admin Columns”, to show the picture in columns https://wordpress.org/plugins/codepress-admin-columns/ 2. You also can code your own admin page with the function add_submenu_page(). http://codex.wordpress.org/Function_Reference/add_submenu_page You can create a query, loop through the posts and show the pictures.