preg_replace not removed “class”

The hook post_thumbnail_html is just working for featured images aka post thumbnails, hence the name. I’m guessing that’s what you’re missing and where the “problem” originates. But luckily there is another hook for manipulating image tags get_image_tag, there is actually one for just altering the class get_image_tag_class too. Take a look into those. Another hook … Read more

Create a link to full-sized image attachment?

I don’t know if TimThumb is really necessary. You could easily do that with internal WordPress functions. Add this code to your functions.php: <?php add_theme_support( ‘post-thumbnails’ ); // this enable thumbnails add_image_size( ‘preview-thumb’, 300, 185, true ); //this sets your default size ?> Use the following code instead of your code above. <div class=”main”> <div … Read more

Images are not showing after moving WordPress installation from server to localhost?

The tip in Part 2 at the site you link that reads Unzip the database you’ve downloaded and open it with text editor (Notepad++ or Dreamweaver) and use “Find and Replace” option to change “http://olddomain.com” with “http://newdomain.com” and then import it with phpmyadmin. is absolutely wrong. Running a find/replace on a database dump with a … Read more

insert image alongwith with custom data via a frontend form

For Image uploads you can use wp_handle_upload(). Adding attachments can be done through wp_insert_attachment(). The association between attachment and your costing item can be achieved through update_post_meta(). Aside: Meta keys starting with an underscore _ are not showing up in WordPress UI. You code could be looking like this: <?php $my_costing_id; /* contains the id … Read more

Stop image resizing in particular case – is that possible?

Use the Filter Hook intermediate_image_sizes_advanced for control the resize function for different sizes. This hook get a array of different sizes and can control your resize with your requirements. Add your logic inside a plugin and remove sizes via this hook. // the hook in core $sizes = apply_filters( ‘intermediate_image_sizes_advanced’, $sizes ); A small example … Read more