I’m trying to add an image in my CSS
That’s because php code inside a CSS file is not parsed unless you configure your server to. Just use it as a relative path to the image (as per the CSS file). background: url(“images/bg.jpg”);
That’s because php code inside a CSS file is not parsed unless you configure your server to. Just use it as a relative path to the image (as per the CSS file). background: url(“images/bg.jpg”);
Tony, are you creating a new post or editing an older post from 2010/07? I’ve found that the folder relates to when the post/page was created initially.
Let’s assume that your theme is NOT rolling its own gallery shortcode, and let’s assume that you’re using the shortcode rather than the ‘gallery’ post format here. What you’re looking for is the ‘gallery_shortcode’ function within wp-includes/media.php around line 750 (as of 3.3.1). That’s where the HTML output of your gallery items is hard-coded. Of … Read more
In general I wouldn’t recommend modifying the original uploaded image files, just in case we might need to re-generate intermediate sizes. But let’s see if it’s possible 🙂 We can in general let WordPress choose the image editor, that depends on modules like GD or Imagick, through: $editor = wp_get_image_editor( $file ); but this can … Read more
After some further digging, I discovered that the max srcset size in WordPress 4.4 is set to 1600px wide by default. You can fix this by adding the following filter: add_filter( ‘max_srcset_image_width’, ‘max_srcset_image_width’, 10 , 2 ); function max_srcset_image_width() { return 2048; } The helper function and this information is thanks to: http://aaronrutley.com/responsive-images-in-wordpress-with-acf
What I eventually did was extending the WP_Customize_Control class as follows: <?php if (!class_exists(‘WP_Customize_Image_Control’)) { return null; } class Multi_Image_Custom_Control extends WP_Customize_Control { public function enqueue() { wp_enqueue_style(‘multi-image-style’, get_template_directory_uri().’/css/multi-image.css’); wp_enqueue_script(‘multi-image-script’, get_template_directory_uri().’/js/multi-image.js’, array( ‘jquery’ ), rand(), true); } public function render_content() { ?> <label> <span class=”customize-control-title”>Image</span> </label> <div> <ul class=”images”></ul> </div> <div class=”actions”> <a class=”button-secondary upload”>Add</a> … Read more
Several options: Out-of-the-box plugin If you’re using Yoast WordPress SEO, you have a built-in setting for Facebook images. Under your SEO > Social menu, go to the Facebook tab and select an image under “Frontpage settings.” You can also set an image as a fallback, for posts that have no featured image, under “Default settings.” … Read more
Scheduled posts don’t trigger publish_post, only updating the post itself will do that. Add an action for future_to_publish, see the reference on post status transitions. I don’t believe that you’ll have access to the user-object in that case, so you might want to refactor that. Alternatively, just get the images when the user saves the … Read more
Its not recommended often enough, but Flickr is an excellent image host for blogs as well. Their pro account costs only $25/year. You get unlimited image, video uploads and no bandwidth limit. If you don’t want your blog image uploads populating your personal photostream, you can easily create a separate account for it. You can … Read more
Try this: $imgs = get_posts(“post_type=attachment&numberposts=-1”); foreach($imgs as $img){ $file = get_attached_file($img->ID); if(!file_exists($file)){ wp_delete_post( $img->ID, false ); } }