get_image_size(get_option('wppl_size','1')); $wppl_priority = get_option('wppl_priority','1'); $args = array( 'post_type' => 'attachment', 'numberposts' => -1, // bring them all 'post_status' => null, 'post_parent' => $post->ID // post id with the gallery ); $atts = get_posts($args); $ns = count($atts); for($i=0;$i<$ns;$i++){ $li .= '
  • '.wp_get_attachment_image($atts[$i]->ID,$wppl_size,0,array("alt"=>"Plant ".($i+1))).'
  • '; } $html = '
    '; return $html; } } //管理员界面 function config_page(){ //检查是否存在提交数据,如果提交则进行修改 if($_POST['flag']){ update_option('wppl_style', $_POST['show_type']);//显示模式 update_option('wppl_size', $_POST['show_size']); if($_POST['show_size']=='4'){ add_image_size('wppl_size_custom',$_POST['c_width'],$_POST['c_height'],true); update_option('wppl_width', $_POST['c_width']); update_option('wppl_height', $_POST['c_height']); } update_option('wppl_priority', $_POST['quanzhong']); update_option('wppl_global',$_POST['gtype']); } //获取管理界面模板数据 //现实方式 $admin_style = get_option('wppl_style','1'); $admin_size = get_option('wppl_size','1'); $admin_priority = get_option('wppl_priority','1'); $admin_global = get_option('wppl_global','1'); $html_style ='
    默认位置 默认位置一般为文章页的正文底部。Default in the text at the bottom.
    自定义 <? wp_piclsit_tag(); ?> 将标签放置在你模版需要展示的地方。The tag into your template file
    '; $html_size = '
    小图规格(thumbnail) 中等规格(medium)
    '; $html_global1 = ($admin_global=='1')?"checked":''; $html_global2 = ($admin_global=='2')?"checked":''; /* 暂时关闭自定义图片规格 $html_size = '
    小图规格(thumbnail) 中等规格(medium)
    自定义(custom) 宽(width)/PX 高(height)/PX
    '; */ $html_priority = ''; $str = file_get_contents(dirname(__FILE__).'/tpl/admin.tpl'); $str = str_replace(array('~style~','~size~','~priority~','~global1~','~global2~'), array($html_style,$html_size,$html_priority,$html_global1,$html_global2), $str); return ''.$str; } } } WP PICLIST | WebCaft.com

    WP PICLIST