douba6361
2014-06-29 04:28 阅读 52
已采纳

自定义帖子类型列表视图列高度和宽度

I created a custom post type for creating different type of charts in wordpress. And created a list view column to preview the chart created in each post type. Everything working fine, but the preview chart is showing in original size. I need to get it in small size just to show preview.

Please have a look at SCREENSHOT HERE: http://s14.postimg.org/szyowvzqp/screenshot_33.png

How can I make the chart preview small in size?

UPDATED DETAILS:

I wrapped the chart with new to set height and width 100px. here is screenshot: http://s14.postimg.org/gcixkdktt/screenshot_35.png Unfortunately, this cut off the chart instead of getting the charts small as the canvas height & width are set. Here is result: http://s14.postimg.org/8iibyzd0x/screenshot_34.png

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    douhezhan5348 douhezhan5348 2014-06-29 07:01

    One way of doing this would be to add custom styles to wp admin. Either by putting them in the <head>or by properly enqueuing them with (this is the preferred way I guess):

    add_action( 'admin_enqueue_scripts', 'load_admin_styles' );
    
    function load_admin_styles() {
        wp_enqueue_style( 'admin_css_foo', get_template_directory_uri() . '/admin-style-foo.css' );
        wp_enqueue_style( 'admin_css_bar', get_template_directory_uri() . '/admin-style-bar.css' );
    }
    

    You could then specify a max-height for the column holding the chart, e.g.:

    .chart {
        max-height: 50px;
    }
    
    点赞 评论 复制链接分享

相关推荐