2013-11-28 36 views

回答

0

我還沒有完全理解你的問題。但至於什麼我也明白了,可能是下面的解決方案可以幫助您:

這是調用頁/職位控件插件:

http://wordpress.org/plugins/widgets-on-pages/

試試上面提到的插件。它可能會幫助你。

希望它可以幫助你.. !!!

0

添加此功能fucntions.php你的主題

function widget($atts) { 
    global $wp_widget_factory;  
    extract(shortcode_atts(array(
     'widget_name' => FALSE 
), $atts)); 

    $widget_name = wp_specialchars($widget_name); 

    if (!is_a($wp_widget_factory->widgets[$widget_name], 'WP_Widget')): 
     $wp_class = 'WP_Widget_'.ucwords(strtolower($class)); 

     if (!is_a($wp_widget_factory->widgets[$wp_class], 'WP_Widget')): 
      return '<p>'.sprintf(__("%s: Widget class not found. Make sure this widget exists and the class name is correct"),'<strong>'.$class.'</strong>').'</p>'; 
     else: 
      $class = $wp_class; 
     endif; 
    endif; 

    ob_start(); 
    the_widget($widget_name, $instance, array('widget_id'=>'arbitrary-instance-'.$id, 
     'before_widget' => '', 
     'after_widget' => '', 
     'before_title' => '', 
     'after_title' => '' 
)); 
    $output = ob_get_contents(); 
    ob_end_clean(); 
    return $output; 

} 
add_shortcode('widget','widget'); 

,並在您發佈這樣

[widget widget_name="Your_Custom_Widget"] 
使用短代碼
相關問題