Tag Info

Hot answers tagged

6

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 ...


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-' . ...


2

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; ...


2

640px is the content size set in your functions.php. Here is an example of the content width set in the bundled theme twentyfourteen in twentyfourteen/functions.php#L28 if ( ! isset( $content_width ) ) { $content_width = 474; } In this example, the image size will be 474 px. The content size will be the size used when images are inserted as ...


2

It appears that your site doesn't use the core WordPress Featured Image feature but instead uses a custom image field (probably from Advanced Custom Fields). Yoast's plugin, Jetpack, and presumably many others look for the Featured Image image when setting the opengraph meta tag. So you have two options: Use the core Featured Image feature with one of the ...


1

Replace the image code with the below one. Actually you are giving the root path in your image source but the image is in your theme folder. Also check if the images folder name is image or images. <img src="<?php bloginfo('template_directory'); ?>/image/logokovil.png" alt="logo" height="100" width="100">


1

You can do this using a plugin. A couple of options are RSS Image Feed WP RSS Images


1

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; } ...


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


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.



Only top voted, non community-wiki answers of a minimum length are eligible