Changing 2011 theme header image based on user dropdown

I had to take information from both of your posts to be able to come with something. Try replacing <img src=”https://wordpress.stackexchange.com/questions/89211/<?php header_image(); ?>” width=”<?php echo $header_image_width; ?>” height=”<?php echo $header_image_height; ?>” alt=”” /> width <?php if (!(isset($_POST[“styles”]))) { //if post not set (first visit) if ($_COOKIE[“chosenStyle”] == “night”) { echo ‘<img src=”‘.get_template_directory_uri() . ‘/images/headers/SomethingOriginalTheMoonAndStars.png” width=”1000″ … Read more

Image attachement management – a philosophical question

WordPress doesn’t have the innate functionality to enumerate attachments as is. Although any attached images can be viewed in the Media Library. In the Media Library, you’ll notice the list of images that are attached to a post have that attribute under the “Uploaded to” column. In that column, lets say for example an image … Read more

Images not showing and plugins not installing on wordpress server move

First thing I would do: In your wp-config.php file, hardcode your new site URL by entering define(‘WP_SITEURL’, ‘http://www.example.com’); define(‘WP_HOME’, ‘http://www.example.com’); After that, have a look at the source code of your pages including images, and verify how the URLs of the the images look like. If they are wrong (relative to localhost?), you may have … Read more

Upload image from other server without resize?

Have a look at media_handle_sideload in source. The function within there that generates the intermediate sizes is wp_generate_attachment_metadata. If you just want to upload the file, you can use the wp_handle_sideload function directly and bypass the meta data and attachment generation.

Link images to post

If you’re adding an image to your post via “Add Media,” you can simply set where you would like the image to link by setting it in the “Link to” field. If you’re adding an image to your post with “Featured Image,” you can add this to your template: <?php if ( has_post_thumbnail()) : ?> … Read more

How to make plugin work in each template in wordpress

You would have to put your code in your question into a function. Maybe something like function wpse_91897_get_image() { }. Then try the code below. I haven’t tested this but it should work. function wpse_91897_display($content) { global $single; $output = wpse_91897_get_image(); if (is_single()) { return $content . $output; } else { return $content; } } … Read more