Options Framework后台主题面板中文版设置调用详解举例

文章目录[隐藏]

使用 of_get_option($id,$default) 调用设置.

建议你阅读 WordPress轻量级后台框架OptionsFramework使用设置举例

基础设置

optionsframework

类型: text (mini)
of_get_option('example_text_mini'): 默认值

  1. of_get_option('example_text_mini'):<?php echo of_get_option( 'example_text_mini', '空值' ); ?>

类型: text
of_get_option('example_text'): 默认值

  1. of_get_option('example_text'):<?php echo of_get_option( 'example_text', '空值' ); ?>

类型: textarea
of_get_option('example_textarea'): 默认文本

  1. of_get_option('example_textarea'):<?php echo of_get_option( 'example_textarea', '空值' ); ?>

类型: select (mini)
of_get_option('example_select'):

  1. of_get_option('example_select'):<?php echo of_get_option( 'example_select', '空值' ); ?>

类型: select2 (wide)
of_get_option('example_select_wide'):

  1. of_get_option('example_select_wide'): <?php echo of_get_option( 'example_select_wide', '空值' ); ?>

类型: select
of_get_option('example_select_categories'): category id =

  1. of_get_option('example_select_categories'): category id = <?php echo of_get_option( 'example_select_categories', '空值' ); ?>

类型: select
of_get_option('example_select_tags'): term id =

  1. of_get_option('example_select_tags'): term id = <?php echo of_get_option( 'example_select_tags', '空值' ); ?>

类型: select
of_get_option('example_select_pages'): page id =

  1. of_get_option('example_select_pages'): page id = <?php echo of_get_option( 'example_select_pages', '空值' ); ?>

类型: radio
of_get_option('example_radio'):

  1. of_get_option('example_radio'): <?php echo of_get_option( 'example_radio', '空值' ); ?>

类型: checkbox
of_get_option('example_checkbox'):

  1. of_get_option('example_checkbox'): <?php echo of_get_option( 'example_checkbox', '空值' ); ?>

高级设置

optionsframework

类型: uploader
of_get_option('example_uploader'):

  1. of_get_option('example_uploader'): <?php echo of_get_option( 'example_uploader', '空值' ); ?>
  2.    <?php if ( of_get_option( 'example_uploader' ) ) { ?>
  3.    <img src="<?php echo of_get_option( 'example_uploader' ); ?>" />
  4. <?php } ?>

类型: image
of_get_option('images'): 2c-l-fixed

  1. of_get_option('images'): <?php echo of_get_option( 'example_images', '空值' ); ?>

类型: multicheck
of_get_option('multicheck'): Array ( [one] => 1 [two] => [three] => [four] => [five] => 1 )

  1. of_get_option('multicheck'):
  2. <?php $multicheck = of_get_option( 'example_multicheck', 'none' ); ?>
  3. <?php print_r($multicheck); ?>

类型: background

  1. <?php $background = of_get_option('example_background');
  2. 			if ( $background ) {
  3. 				if ( $background['image'] ) {
  4. 					echo '<span style="display: block; height: 200px; width: 200px; background:url(' . $background['image'] . ') "></span>';
  5. 					echo '<ul>';
  6. 					foreach ( $background as $i=> $param ){
  7. 						echo '<li>'.$i . ' = ' . $param . '</li>';
  8. 				}
  9. 				echo '</ul>';
  10. 				} else {
  11. 					echo '<span style="display: inline-block; height: 20px; width: 20px; background:' . $background['color'] . ' "></span>';
  12. 					echo '<ul>';
  13. 					echo '<li>'.$background['color'].'</li>';
  14. 					echo '</ul>';
  15. 				}
  16. 			} else {
  17. 				echo "没有值";
  18. 			}; ?>

类型: typography

  1. <?php $typography = of_get_option('example_typography');
  2. 			if ( $typography ) {
  3. 				echo '<ul>';
  4. 				foreach ( $typography as $i => $param ) {
  5. 					echo '<li>'.$i . ' = ' . $param . '</li>';
  6. 				}
  7. 				echo '</ul>';
  8. 				echo '<span style="font-family: ' . $typography['face'] . '; font-size:' . $typography['size'] . '; font-style: ' . $typography['style'] . '; color:'.$typography['color'] . ';">Some sample text in your style</span>';
  9. 			} else {
  10. 				echo "空值";
  11. 			} ?>

类型: editor

  1. <?php echo of_get_option( 'example_editor', '空值'); ?>

发布日期:

所属分类: Wordpress, Wordpress 插件 标签:  



没有相关文章!