douba6361 2014-06-29 04:28
浏览 54
已采纳

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

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 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;
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)