Tag Info

New answers tagged

0

I ended up modifying slightly to use data-filter instead of rel. Works perfectly in combination with the isotope j-query plugin. add_filter( 'get_image_tag', function( $html, $id ) { $dataFilter = array(); foreach( (array) get_the_category( $id ) as $cat ) { $dataFilter[] = $cat->slug; } ...


0

Whenever I'm trying to link two sites, I find the most efficient and least destructive way is to use the WordPress XMLRPC API. http://codex.wordpress.org/XML-RPC_WordPress_API/Posts In this case, you could pull this info through using the built in IXR_Client library. This saves a ton of time writing code and trying to mix databases. If they wind up on ...


5

Yes, is possible and pretty easy. This is the workflow I suggest: Put somewhere an UI to insert the url of the featured image. Probably best choice is to use 'admin_post_thumbnail_html' filter hook Use 'save_post' action hook to save the url (after security and validation routine) in a custom post meta Use 'post_thumbnail_html' filter hook to output ...


0

the quickest/easiest (relative terms) way I would think is to put all the currently functioning images into a single subfolder and do a bulk find-replace in the database to fix/update that (be mindful of serializing). Then, moving forward, a yearly folder structure would seem to solve your problem well. If you haven't run into an issue for this long you ...


0

You can try to reduce number of images. Wordpress creates lots of different image sizes (up to several of every image you uploaded), but actually you do not use all of them in most cases. Also during years you probably deleted/edited some posts/images, but some images are probably still on your disk, even not used in posts now. So you can delete images not ...


1

I found the problem to be the size of the images. The iphone has a maximum size for images. See: http://stackoverflow.com/questions/14324646/background-image-does-not-show-on-iphone-ipad


0

I didn't fully undrestand your question but I'll try to give you answer. WordPress support only 1 featured image.Inside one WordPress post you can add unlimited number of images. If You want make a gallery (from images which you have) you can use plugin (ex. https://wordpress.org/plugins/nextgen-gallery/ ) Please give more info, if you want better answer.


0

The simplest way is to keep you styles as it is now. Just limit your container using pixel or percentage. For example: If you limit your to your image size - your image will stretch until there until there and not further. If you image size is 200px - then, see below for your final style set. #content { max-width: 200px; width: 100%; } img { ...


1

This should work for the rel attribute: /** * Create a rel attribute from the image categories * * @see http://wordpress.stackexchange.com/a/158024/26350 */ add_filter( 'get_image_tag', function( $html, $id ) { $rel = array(); foreach( (array) get_the_category( $id ) as $cat ) { $rel[] = $cat->slug; ...


0

Wordpress doesn't have the option to add extra information to taxonomies. There isn't any taxonomy_meta table. So, you have two options. Create a new custom table and save the extra information(image link) there. You can also use options table to store the information. You can follow this post of as it shows how to implement what you are trying to do: ...


0

Deleting images using plugin: You can use this plugin, it will search your database and look if image is inserted into any post (in content, as featured image, in any custom field, anywhere...) or as background... If image is not used anywhere it will give you option to delete it. You will get list of all images on your site not used anymore, so you can ...


0

Check the parameters for the_post_thumbnail Thumbnail Sizes the_post_thumbnail( array(100, 100) ); Or you can add a custom image size for featured images using add_image_size in your function file which includes the width and height add_image_size( 'postbox-thumb', 100, 100, TRUE );


0

It would be helpful if you added a link to your site. While you may have included a picture in the post, it's important that you designate a featured image. That may help resolve the issue. From the Publicize website (http://en.support.wordpress.com/publicize/) Facebook and Twitter Publicize typically select images that are at least 200 x 200 pixels in ...


0

I just fixed this after several hours of research. If one need to do the same thing, he must edit file wp-includes\js\media-views.js and replace add with unshift in this line (#2611, galleryAddToolbar): edit.get('library').add( state.get('selection').models ); So the code will look like this: edit.get('library').unshift( state.get('selection').models ); ...


0

I think that you're adding the code inside the loop of index.php or blog template file. You might be try this kind of things: if ( class_exists( 'MultiPostThumbnails' ) && ( MultiPostThumbnails::has_post_thumbnail( get_post_type(), 'header-image' , get_the_ID() ) ) ) { MultiPostThumbnails::the_post_thumbnail(get_post_type(), ...


1

Next time having a look at the docs might help ;) MultiPostThumbnails::has_post_thumbnail( $post_type, $id, $post_id = null ) Source: https://github.com/voceconnect/multi-post-thumbnails/wiki/Functions-and-Template-Tags#has_post_thumbnail I guess you can make it from here. If not let us know.


0

This might be perfect solution for you: http://wordpress.org/plugins/custom-upload-dir/ With that plugin you can have upload folder structure as you wish: "uploads/$image_type./.$client./.$post_title./" or uploads/category/subcategory/post_title/ Or anything you like, you can combine post title, category, post author, post date and many more in your ...


0

The answer was to assign a count to each attachment: $args = array( 'post_type' => 'attachment', 'numberposts' => -1, 'post_status' => null, 'post_parent' => $post->ID, 'order_by' => 'menu_order', 'order' => 'DESC' ); $attachments = get_posts( $args ); if ( $attachments ) { $count = 0; foreach ...


3

This should hopefully do the trick: /** * Append the image categories to the current image class. * * @see http://wordpress.stackexchange.com/a/156576/26350 */ add_filter( 'get_image_tag_class', function( $class, $id, $align, $size ) { foreach( (array) get_the_category( $id ) as $cat ) { $class .= ' category-' . ...


0

The only way to do it is using a query filter I think function wpse156319_posts_where( $where, $query ) { global $wpdb; $where .= $wpdb->prepare( ' AND (' . $wpdb->posts . '.post_parent = %s OR ' . $wpdb->posts . '.post_author = %s)', $_POST['id'], get_current_user_id() ); return $where; } which you just add in the ...


0

There's a good answer to this question here: http://www.sitepoint.com/wordpress-change-img-tag-html/ His second example is pretty much what you're looking for. Let me know if you need any further help with this. The main chunk from that answer that concerns you is this: function image_tag($html, $id, $alt, $title) { return preg_replace(array( ...


0

Here's a heinous hack that replaces the title of uploaded images with the url (constructed by chopping the "-150x150" affix from the pinkynail): function wpse156087_admin_footer_media_new_php() { ?> <script type="text/javascript"> jQuery(document).ready(function() { (function ($) { uploader.bind('UploadComplete', function() { ...


0

Work with the options found under Gallery > Other Options > Lightbox Effects ... "What must the lightbox be applied to?" These will allow other images not in the NextGEN Galleries to be opened into the Lightbox Effect you have chosen.



Top 50 recent answers are included