<a class=”bs-author-pic mb-3″ href=”<?php echo esc_url(get_author_posts_url( get_the_author_meta( ‘ID’ ) ));?>”><?php echo get_avatar( get_the_author_meta( ‘ID’) , 150); ?></a>
]]>But the images of each timeline-item (the one above the Headline and the text) do only have empty alt-attributes. The information from the medalibrary are not shown. It would be great to display the alt-tags in the image-tag.
]]>I have some radio buttons with images instead of text. When a user selects a radio button I would like to display the title of this image in a text field or calculated field.
Is this possible?
Thanks in advance!
]]>my_seo_title
.When I came back to the site to add new content yesterday, it was as if my account had no privileges. I couldn’t create pages, upload images or modify users. With the help of my hosting company, the problem was traced to a database corruption, which was fixed.
Today, I could upload content, but when I upload images, they appear as blank tiles in the media library. When added to the page, WordPress leaves the image source attribute empty (src=””). Of course, the images do not display on the page or the editor. I can find the url for the image in the database and paste it into the page, but it’s not a good workaround. (The theme, for one, still doesn’t know where the images are.)
I’ve disabled plugins, cleared the cache, checked filesystem privileges, checked the upload file path, and had the hosting company look at the .htaccess file. None of these make any difference.
It sounds like there’s an uninitiated variable somewhere in the code, but I have no idea where to look. Scratching my head over this one.
]]>The problem
The script requires an img attribute of data-adaptive-background=’1′
I can’t seem to include the attribute onto the image. I realize that the_post_thumbnail(); accepts two parameters one of which is an array for adding in attributes. Apparently though, I am doing it wrong. I’m still learning so not sure of the correct syntax for everything. Currently I have the Mutliple Post Thumbnail plugin activated and the following code is placed in my functions.php file:
if (class_exists('MultiPostThumbnails')) {
new MultiPostThumbnails(
array(
'label' => 'Portfolio Image',
'id' => 'folio-image',
'post_type' => 'post'
)
);
}
On my single.php file I’ve included:
<div id="folio-image">
<?php if (class_exists('MultiPostThumbnails')) :
MultiPostThumbnails::the_post_thumbnail(
get_post_type(),
'folio-image'
);
endif; ?>
</div>
The image displays as needed. But I’m not sure how to include the needed attribute. This link on Stackoverflow says to include it like so: the_post_thumbnail( 'folio-image', array( 'data-adaptive-background' => 1 ) );
I can’t seem to figure out where to place that having tried multiple times.
I feel like the answer seems to be in the plugin documentation here. Where it says to use the wp_get_attachment_image()
argument for adding attributes. But after trying several approaches and getting not much more than a few parse errors and/or no change to the image at all, I haven’t been successful in including the needed atttribute.
Thanks in advance for any help you might have. I always appreciate the WP community’s willingness to help.
]]>if ( $postinfo ) :
echo '<p class="post-meta" itemprop="datePublished">';
echo et_pb_postinfo_meta( $postinfo, et_get_option( 'divi_date_format', 'M j, Y' ), esc_html__( '0 comments', 'Divi' ), esc_html__( '1 comment', 'Divi' ), '% ' . esc_html__( 'comments', 'Divi' ) );
echo '</p>';
endif;
but I am having trouble with: when php generates the html<img>
tag for thumbnails (if it even does that)
I think I’ve looked for all the typical things in all the files: things like
$thumb
or
the_post_thumbnail()
Please let me know if anyone can help.
I’m looking to achieve that img has itemprop=”image” and looks like this across all blog posts:
<img src="https://.jpg" alt="alt" width="1080" height="675" itemprop="image">
Thank you. I’m not so savvy so I appreciate your help.
]]>I am displaying featured images with medium size on feed pages. I added <?php the_post_thumbnail('medium'); ?>
on the loop template file.
And, for schema.org markup, I also added itemprop image attribute to the featured images with below code on my theme’s functions.php.
add_filter('wp_get_attachment_image_attributes', 'ipwp_img_attr', 10, 2);
function ipwp_img_attr($attr) {
$attr['itemprop'] = 'image';
return $attr;
}
The result is:
<img src=”https://my-site.com/wp-content/uploads/YYYY/MM/my-image.png” class=”attachment-medium wp-post-image” alt=”My Image” itemprop=”image”>
It’s missing width and height attributes. I need them to score higher on page speed tests.
Anyone knows how to add the width and height attributes there?
]]>Problem: IE 10 is changing the source attribute for all images on this site. For example, if we have a background-image: abc.png, IE 10 will change it to background-image:none for the attribute.
Never seen this before.
Suggestions?
]]>