WordPress adds extra width to post images container boxes
something I wrote a while ago: ‘Adjusting Caption Frame Width’
something I wrote a while ago: ‘Adjusting Caption Frame Width’
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)
before copy/pasting the database from your local machine to the production server, you should do a Find & Replace on the domain name. this way you replace localhost:40952 with the correct domain on every url in the database. or read the part ‘Moving WordPress to a New Server’ on the codex.
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; }
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; }
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.’&tab=library’; } If you want the default tab to be the uploader, but you want it to load faster, … Read more
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
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
if you’ve monkeyed with your www structure you can change the image URLs (since they are hard-coded in the img src) using the following plugin: http://wordpress.org/extend/plugins/velvet-blues-update-urls/
EDITED ANSWER Forget every thing i said before. Here is what i have found the following In php to generate a website thumbnail, you cant do it natively with php’s built in functions, so you have to call an external service or program to do it for you. Since wordpress is basically php , this … Read more