Include caption underneath post images

the following should just show the caption: echo ‘<div class=”slideshow-content”><img src=”‘.wp_get_attachment_url($attachment->ID, ‘thumbnail’, false, false).'” /><div class=”captions”>’.apply_filters(‘the_excerpt’, $attachment->post_excerpt).'</div></div>’; (applying the excerpt filter adds the paragraph tag automatically)

Stripping the_content() from images then displaying them seperately

maybe use this regex: $pattern = “/<a(.*?)href=(‘|\”)([^>]*)(‘|\”)(.*?)><img(.*?)src=(‘|\”)([^>]*).(bmp|gif|jpeg|jpg|png)(‘|\”)(.*?)class=(‘|\”)([^>]*)(‘|\”)(.*?)\/><\/a>/i”; function example_replace ($content) { global $post; $pattern = “/<a(.*?)href=(‘|\”)([^>]*)(‘|\”)(.*?)><img(.*?)src=(‘|\”)([^>]*).(bmp|gif|jpeg|jpg|png)(‘|\”)(.*?)class=(‘|\”)([^>]*)(‘|\”)(.*?)\/><\/a>/i”; $replacement=”<a$1href=$2$3$4$5><img$6src=$7$8.$9$10$11class=$12$13 <strong>imagelink</strong>$14$15$16/><\/a>”; $content = preg_replace($pattern, $replacement, $content); return $content; }

Set jpeg_quality for certain post-types

You can hook into the jpeg_quality filter and do a check for the post type you want to apply the filter to. add_filter( ‘jpeg_quality’, ‘my_jpeq_quality’ ); function my_jpeg_quality( $quality ) { if ((isset($_GET[‘post_type’]) && $_GET[‘post_type’] == ‘your_post_type’) || (isset($post_type) && $post_type == ‘your_post_type’)) : return 100; //Set quality here endif; }

Faster way to put images into a blog post by using Add Media dialog

Nothing here is a silver bullet, but here are some suggestions: If you find yourself using your library more than uploading new images, you can make the default tab “Library”: add_filter(‘_upload_iframe_src’, ‘change_default_media_tab’); function change_default_media_tab($uri) { return $uri.’&amp;tab=library’; } If you want the default tab to be the uploader, but you want it to load faster, … Read more

How can I insert an image map into a WordPress blog post?

yes, it should achievable like this .. <div> <img class=”alignnone” id=”imageMaps” src=”http://businessplumbing.com/wp-content/uploads/2011/11/Sloan-Royal-Flushometer.png” alt=”” width=”298″ height=”595″ usemap=”#flushometer” border=”0″ /> <map name=”flushometer” id=”flushometer”> <area shape=”rect” coords=”219,6,277,41″ href=”http://businessplumbing.com/products-page/lavatory-sink/sloan-royal-flushometer-a-72-cp-cover/” alt=”A-72 CP Cover” /> <area shape=”rect” coords=”218,42,278,70″ href=”http://businessplumbing.com/products-page/lavatory-sink/sloan-royal-flushometer-a-71-inside-cover/” alt=”A-71 Inside Cover” /> </map> </div> copy the whole code (including div) and paste in HTML tab in editor . the top … Read more

Creating a thumbnail from an image already on the server?

Looking at your code, it looks like the file wil be looked for in …/wp-content/uploads/bill.jpeg. You’ll need to include the yyyy/mm as well. I would use this: require_once(ABSPATH . ‘/wp-admin/includes/media.php’); require_once(ABSPATH . ‘/wp-admin/includes/image.php’); $file=”http://www.mysite.org/uploads/uploaddir/2012/02/bill.jpeg”; # Function reference # image_resize ( $file, $max_w, $max_h, $crop = false, $suffix = null, $dest_path = null, $jpeg_quality = 90 … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)