Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress页面布局_Wordpress_Themes - Fatal编程技术网

Wordpress页面布局

Wordpress页面布局,wordpress,themes,Wordpress,Themes,我想显示两列,右边的一个栏中充满了谷歌adsense。如何更改wordpress主题中页面的默认一栏布局?您必须编辑functions.php文件,然后手动将区域和新边栏添加到页面中您希望添加的区域中 所以我们假设它是index.php 您将打开functions.php文件,然后添加此代码 在管理窗口中创建小部件和侧栏部分 if ( function_exists('register_sidebar') ) register_sidebar(array('name'=>'YOUR NEW

我想显示两列,右边的一个栏中充满了谷歌adsense。如何更改wordpress主题中页面的默认一栏布局?

您必须编辑functions.php文件,然后手动将区域和新边栏添加到页面中您希望添加的区域中

所以我们假设它是index.php

您将打开functions.php文件,然后添加此代码

在管理窗口中创建小部件和侧栏部分

if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'YOUR NEW SIDEBAR',
'before_widget' => '<div class="block">',
'after_widget' => '</div><div class="blockfooter"></div>',
'before_title' => '<h3>',
'after_title' => '</h3>',
));
if(函数_存在('register_边栏'))
register_侧栏(数组('name'=>“您的新侧栏”,
'在小部件'=>''之前,
'在小部件'=>''之后,
“在标题“=>”之前,
“在标题“=>”之后,
));
然后,您将此部件添加到页面中需要添加的区域。使用Div等样式,或者按照您需要的方式完成

<?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('YOUR NEW SIDEBAR')); ?>

让我知道这有帮助