Easy way to update a single translation entry without having to translate

Sure, the gettext filter does exactly what you require. Here’s some code that should work out of the box: function wpse31449_translate_my_stuff($translation, $text, $domain) { if ($text == ‘Featured Image’) return ‘Post Image’; return $translation; } add_filter( ‘gettext’, ‘wpse31449_translate_my_stuff’, null, 3 ); Note: if the translation is retrieved with a gettext context (_x() and _ex()) then … Read more

Image Alignment on Featured Images

Short answer: you don’t. The alignment settings only apply to images that the user adds to the Post Content. The Featured Image is incorporated into the template and is not added by the user to the Post Content. The Featured Image is directly integrated into the template, usually as a “post thumbnail” displayed on archive … Read more

Resizing thumbnails retrospectively

I never had much luck with that AJAX plugin either, but ViperBond’s Regenerate Thumbnails works perfectly for me on a number of sites: viper007bond.com/wordpress-plugins/regenerate-thumbnails It manages several thousand images on my server, albeit somewhat slowly, although you can also run it on individual images or batches of images from the Media library. If you have … Read more

How to hide image-url if no attachment?

Assuming you’re following this tutorial: http://wp.tutsplus.com/tutorials/automagic-post-thumbnails-image-management/ Replace the echo statement at the end of get_attachment_picture with a return, then change your image code. Here is your new image code: // get the URL of the image $src = get_attachment_picture(); // if the url is not empty, display the image if(!empty($src)){ ?> <img src=”https://wordpress.stackexchange.com/questions/48896/<?php echo $src; … Read more

Apply class to every third list item? [duplicate]

add a simple counter and conditional check: $pages = get_pages(‘child_of=10’); $counter = 1; if ($pages) { echo ‘<ul class=”projectthumbs”>’; foreach ($pages as $page) { if ($counter == 3){ $class=” class=”YOUR_CLASS””; $counter = 1 }else{ $class=””; $counter = $counter +1; } echo ‘<li’.$class.’><a href=”‘.get_permalink($page->ID).'”>’; echo get_the_post_thumbnail($page->ID); echo ‘<span class=”projectthumbtitle”>’; echo get_the_title($page->ID); echo ‘</span>’; echo ‘</a></li>’; } … Read more

Getting the Featured image URL and inserting it as Custom Field on Post update / publish

The function get_post_thumbnail_id() needs a value to be passed if using outside the wordpress loop. You forgot to pass it. The code you’re using will create a new custom field on each update so here’s the modified code that’ll perform update_post_meta function if that meta_key is already present in database. The bellow code is tested … Read more

is there a way to remove featured image from blog page and single page

If you don’t want to modify the template files directly, you could always make use of the post_thumbnail_html filter: function wpse70960_filter_post_thumbnail_html( $html ) { if ( ( is_home() || is_single() ) { return ”; } else { return $html; } } add_filter( ‘post_thumbnail_html’, ‘wpse70960_filter_get_post_thumbnail_html’ ); This code snippet goes either in your functions.php file or … Read more