I added the ability to use SVG as graphics on my site. They are showing up fine on the front end, but I'm having 2 issues on the backend.
The problem is that I want to show post thumbnails on the admin backend. Png and jpg work fine with this code:
//adds thumbs to admin edit columns for posts and CPTs
add_filter('manage_posts_columns', 'posts_columns', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);
function posts_columns($defaults){
$defaults['rt_post_thumbs'] = __('Thumbs');
return $defaults;
}
function posts_custom_columns($column_name, $id){
if($column_name === 'rt_post_thumbs'){
echo the_post_thumbnail( array(50,50) );
}
}
However when I add an SVG to a featured image, no matter what I do for echoing the size (3rd to last line above) the svg renders at full size. Other graphics respect my size restrictions. Is there a way to constrain the SVG as well?
Additionally the SVG doesn't always show up in the post edit section under the featured image section, (it just shows as a blank area) but I'm not nearly as worried about that.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744923334a4601271.html
评论列表(0条)