我有一个问题,我有一个插件(newsletter) 它有一个小部件,用户可以(通常)订阅新闻稿和其他功能。
但我离题了。
我一直在尝试创建自己的wordpress模板,仅供个人使用。下面是我积累的代码,这些代码逐渐形成了一个功能性提要栏,但到目前为止还没有成功。非常感谢您的帮助。谢谢
index.php
<div id="content" class="alignCenter">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
</div>
<?php get_sidebar(); ?>
functions.php
<?php /** * Register our sidebars and widgetized areas. * */
function arphabet_widgets_init() {
register_sidebar( array( \'name\' => \'Home right sidebar\', \'id\' =>
\'home_right_1\',
\'before_widget\' => \'<div>\',
\'after_widget\' => \'</div>\',
\'before_title\' => \'<h2 class="rounded">\',
\'after_title\' => \'</h2>\',
) );
}
add_action( \'widgets_init\', \'arphabet_widgets_init\' );
?>
Sidebar.php (taken from twentyfourtine theme )
<?php
/**
* The Sidebar containing the main widget area
*
* @package WordPress
* @subpackage Twenty_Fourteen
* @since Twenty Fourteen 1.0
*/
?>
<div id="secondary">
<?php
$description = get_bloginfo( \'description\', \'display\' );
if ( ! empty ( $description ) ) :
?>
<h2 class="site-description"><?php echo esc_html( $description ); ?></h2>
<?php endif; ?>
<?php if ( has_nav_menu( \'secondary\' ) ) : ?>
<nav role="navigation" class="navigation site-navigation secondary-navigation">
<?php wp_nav_menu( array( \'theme_location\' => \'secondary\' ) ); ?>
</nav>
<?php endif; ?>
<?php if ( is_active_sidebar( \'sidebar-1\' ) ) : ?>
<div id="primary-sidebar" class="primary-sidebar widget-area" role="complementary">
<?php dynamic_sidebar( \'sidebar-1\' ); ?>
</div><!-- #primary-sidebar -->
<?php endif; ?>
</div><!-- #secondary -->