How to set path with WP_Filesystem and ftp base / chroot

After changing FTP_BASE in my wp-config i found the update function of WP broken. Then i realize the update function work the same way and don’t need any additional settings. In wp-admin/includes/update-core.php i found the usage of $wp_filesystem->wp_content_dir(). This solves my problem too. On http://xref.wordpress.org/branches/3.8/WordPress/Filesystem/WP_Filesystem_Base.html you will find a list of possible useful functions: string … Read more

Subdirectory install error

I had forgotten to define the location of wp-content in my wp-config.php : define( ‘WP_CONTENT_DIR’, dirname(__FILE__) . ‘/wp-content’ ); define( ‘WP_CONTENT_URL’, ‘http://’.$_SERVER[‘SERVER_NAME’].’/wp-content’ ); define( ‘WP_PLUGIN_DIR’, dirname(__FILE__) . ‘/wp-content/plugins’ );

Moving functionality from functions.php to classes?

This code https://github.com/chriscoyier/css-tricks-functionality-plugin does exactly what you’ve described with regard to classes. Although the associated article https://css-tricks.com/wordpress-functionality-plugins/ is about removing non-theme specific functionality out of functions.php to a separate plugin it will give you an insight into the code. HOWEVER: PHP includes do have a performance overhead. I have also read (older versions of PHP) … Read more

Unexpected width and srcset attributes for the_post_thumbnail();

When generating the width and height attributes for an image with functions like the_post_thumbnail() or wp_get_attachment_image() the images are put through the image_downsize() function. The last thing this function does is run the image through the image_constrain_size_for_editor() function. This function decides the width and height of the image based on the given size, large in … Read more