怎样修改WordPress自带的功能等小工具(Widget)
你好,你是想去掉其中不想要的链接吧?看下面:function coolwp_remove_meta_widget() {/*移除Wordpress自带的Meta小工具*/unregister_widget('WP_Widget_Meta');/*注册自己的Meta小工具*/register_widget('WP_Widget_Meta_Mod');}add_action( 'widgets_init', 'coolwp_remove_meta_widget' );/*自定义小工具扩展类*/class WP_Widget_Meta_Mod extends WP_Widget {function __construct() {$widget_ops = array('classname' => 'widget_meta', 'description' => __( "Log in/out, admin, feed and WordPress links") );parent::__construct('meta', __('Meta'), $widget_ops);}function widget( $args, $instance ) {extract($args);$title = apply_filters('widget_title', empty($instance['title']) ? __('Meta') : $instance['title'], $instance, $this->id_base);echo $before_widget;if ( $title )echo $before_title . $title . $after_title;?><?php wp_register(); ?><?php wp_loginout(); ?><?php wp_meta(); ?><?phpecho $after_widget;}function update( $new_instance, $old_instance ) {$instance = $old_instance;$instance['title'] = strip_tags($new_instance['title']);return $instance;}function form( $instance ) {$instance = wp_parse_args( (array) $instance, array( 'title' => '' ) );$title = strip_tags($instance['title']);?><?php _e('Title:'); ?> <?php}}将上述代码添加到你当前的主题或已启用的插件中即可,示意截图:祝愉快!
WordPress小工具尺寸和位置怎么调整?
你这个位置要通过css调 你在你用的主题里修改对应的style.css。
不清楚零基础建站是什么。
不过Wordpress要求不高吧。
如果你不需要修改样式的话,直接选一个主题就可以搞了。
修改样式也只要了解基础的php,h5+css就行了~WordPress手把手建站教程
如何修改WordPress小工具的输出样式
主题没有开启小工具的功能,但是模板里面有设置小工具的函数,所以显示正常。
找到主题文件下的function.php文件。
文件是以结束的,我们只要把下面的代码加到 ?>;之前就好。
if( function_exists('register_sidebar') ) {register_sidebar(array('before_widget' => '
转载请注明出处51数据库 » wordpress小工具浮动
陌上烟雨心上尘-