media_sideload_image with rewritten urls?

You’re right, it’s because by default, wp_handle_sideload() requires a valid extension in the URI in order to continue processing the sideload. That is, unless your role has a capability called ‘unfiltered_upload‘, which by default is only given to admins. If it seems appropriate (and safe) for you to grant this capability to the user role … Read more

Moving a test WP site to live

You can easily update the Site Url in WP, In the general settings of the Admin section (/wp-admin/options-general.php). Be sure the set the correct URL in the ‘WordPress Address (URL)’ and ‘Site Address (URL)’ fields. You may want to check your config file (wp-config.php) too, if you need to switch databases while moving from Test … Read more

Echo URL of large version of Featured Image

Use the second parameter of wp_get_attachment_image_src(): $size. $att = wp_get_attachment_image_src( $att_ID, ‘large-thumb’ ); or $att = wp_get_attachment_image_src( $att_ID, array ( 900, 300 ) ); The size is passed to image_downsize() and there to image_get_intermediate_size(). If $size is an array WordPress will search for the best match in existing images: // from wp-includes/media.php::image_get_intermediate_size() // get the … Read more

Creating a dynamic URL structure

Demonstrated here: http://thereforei.am/2011/10/28/advanced-taxonomy-queries-with-pretty-urls/ Here’s the final code to autogenerate the necessary rules: It’s quite likely you will at some stage want to programmatically generate rewrite rules for multiple custom post types with various taxonomies. You could do it manually, but that’s no fun. Let’s use an automatic rewrite rule generator. The function below takes a … Read more

Shortcode for a link and thumbnail

You are assigning the attachment URL to your $url variable: $url = wp_get_attachment_url( get_post_thumbnail_id( $id ) ); then passing that same variable back to wp_get_attachment_url: return ‘<img src=”‘ . wp_get_attachment_url( $url ) . ‘”/><a href=”‘ . get_permalink( $id ) . ‘”>’ . get_the_title( $id ) . ‘</a>’; You should simply output it instead: return ‘<img … Read more

Author Nickname URL Friendly

You’ve already used sanitize_title once in you code. You need to use that in again, inside the wpse5742_author_link function. $link = str_replace( $author_nicename, sanitize_title($author_nickname), $link ); That should take care of the spaces. Another other option is to use urlencode but sanitize_title keeps things consistent. I (minimally) tested your code with that change and it … Read more