您当前的位置:首页 > TAG信息列表 > register-sidebar
注册侧边栏和边栏小工具。不显示侧边栏小部件
我正在注册边栏和边栏小部件。该主题目前支持两个侧栏。主要和次要。add_action(\'widgets_init\', array($this, \'add_sidebars\'), 10, 2);public function add_sidebars(){ register_sidebar(array( \'name\' => \'Primary Sidebar\', \'id\' => \'mbe-sidebar-prim
由于ID已更改,因此复制小部件设置
我想将客户博客更新为基于实际部署主题的更新版本的子主题。我的问题是,该主题的开发人员更改了侧栏的ID。在旧版本中register_sidebar() 调用时未提供ID,因此WP使用数字ID。现在开发人员将IDs命名为AlphaNumeric(home-1, home-2, 等等)。我无法找到如何将数据库中的小部件设置从一个侧栏复制到另一个侧栏。因此,我在旧主题中注册了新的侧栏ID,在新主题中注册了旧的侧栏ID。比我用的Duplicate Widget Plugin 复制新侧栏中的小部件。当我预览新主题时,
自定义侧边栏未显示在仪表板中
我正在尝试创建一个新的提要栏。为此,我使用了以下代码:在里面functions.phpif ( function_exists(\'register_sidebar\') ) register_sidebar(); if ( function_exists (\'register_sidebar\')) { register_sidebar (\'sidebar-custom\'); } 然后我创建了一个名为sidebar-custom.php.该文件
挂钩到Widget输出循环
当wordpress边栏输出任何特定registered sidebar 它循环通过它分配的所有小部件并输出它(我猜)。可以挂接到循环中并添加一些内容,例如I want to add a ad code every three widgets.What I have tried? 找不到任何线索。试图搜索wordpress源代码,但不确定要搜索什么。正在搜索widget 或widget loop 没有帮助。
将#侧边栏-2添加到自定义页面模板
我注册了一些自定义侧栏,我的Twentyle2Theme版本中的相应代码现在如下所示: register_sidebar( array( \'name\' => __( \'Sidebar #1\', \'twentytwelve\' ), \'id\' => \'sidebar-1\', \'description\' => __( \'Appears on posts and pages except the optional F
如何增加侧边栏支持的最大数量?
如何在wordpress中使用20多个边栏。我正在开发一个大型信息门户,我需要大量的侧边栏(我想大约40个)。所以我现在有20个侧边栏,当我再添加一个时,它会覆盖之前输入的一个侧边栏。我在网上搜索了类似的问题,但什么也没找到。。。有人能帮我摆脱这种状况吗?Link 至现场
小部件在使用Get_Sidear()后未激活警报
在使用get_sidebar() 中的函数header.php. 我在中插入了以下代码function.php:function myfunc_sidebars_init() { register_sidebar(array( \'name\' => __(\'Main Sidebar\', \'mytheme\'), \'description\' => __(\'Widget area for the main sidebar
侧栏小部件-动态CSS:小部件标题的问题
幸运或不幸的是,我没有做太多的研究,为我的客户的网站制作了一个动态边栏小部件区域。我的functions.php 代码为:... register_sidebar( array ( \'name\' => \'Left Widget Area\', \'id\' => \'primary_widget_area\', \'before_widget\' => \'<li id=\"%1$s\" class=\"widget %
Dynamic Sidebar Conditional
EDIT在此处找到答案:is_active_sidebar() Always Returns False按用户:s_ha_dum我正在动态创建侧栏,并为每个顶级页面注册它们:Dynamically Register Sidebars For Each Top Level Page问题是,我想测试该页面是否不存在边栏,以使用默认值:if(is_dynamic_sidebar(get_the_title())) dynamic_sidebar(get_the_t
如何使用forloop和Register_侧边栏创建多个侧栏区域?
我试图使用一组页面模板(如日期、存档、标记等)创建8个侧边栏区域,然后在数组中循环,为每个值创建一个侧边栏。我认为应该这样做,但它只会为数组中的最后一个值创建一个侧栏:$widget_areas = array(\'single\',\'index\',\'category\',\'archive\',\'tag\',\'taxonomy\',\'author\',\'date\',\'search\',\'attachment\'); foreach($widget_areas as $area
仅在单个帖子上自定义边栏
我正在为新的213主题开发一个儿童主题,并试图在我的内容旁边添加一个侧栏(小部件区域)。我只想在single 职位。我所做的:编辑单曲。php(并将其添加到我的子主题文件夹)如下所示:get_header(); ?> <div id=\"primary\" class=\"content-area\"> <div id=\"content\" class=\"site-content\" role=\"main\">
键($GLOBALS[‘wp_REGISTERED_SIDEDARS’])始终显示相同的值
我使用的代码来自another answeradd_action( \'dynamic_sidebar\', \'wpse_96681_hr\' ); function wpse_96681_hr( $widget ) { static $counter = 0; // right sidebar in Twenty Ten. Adjust to your needs. if ( \'sidebar\' === key(
如何:向侧栏小部件列表添加类-项
最新版本的Bootstrap(v3.0)添加了List Group 具有以下结构的组件:<ul class=\"list-group\"> <li class=\"list-group-item\">Cras justo odio</li> <li class=\"list-group-item\">Dapibus ac facilisis in</li> <li class=\"list-group-i
寄存器侧栏中的“Class”参数的用例是什么?
我注册了一个新的侧栏并填写了class 参数(请参阅代码),然后我放入一个归档小部件,并查找我的“测试”类。Not there.那么,类参数的作用是什么呢。我可以看一个例子吗?register_sidebar( array( \'name\' => __(\'Footer Widget One\', \'wpbs-framework\'), \'id\' => \'footer-01\', \'cl
寄存器侧边栏中的小部件标题标记
为什么我在register\\u侧栏的“before\\u title”和“after\\u title”设置中指定的标记会应用于默认文本WordPress小部件,而不是我们的自定义小部件,而两者都在同一侧栏中,并且在小部件设置中都有标题?例如,当我设置register_sidebar( array( \'name\' => $name, \'id\' => $id, \'b
2个已注册的动态侧边栏,未显示
我的目的是在每页上都有一个左右侧边栏。我已经注册了这两个小部件,实现了我想要的小部件,但有些地方不太对劲。左侧边栏(sidebar(1)) 在左侧正确加载,但卡在页面内容下方。右侧边栏(sidebar(2)) 虽然它在外观>小部件中显示为活动状态,但根本不会显示在页面上。我忽略了什么?如何才能使两个侧边栏正常显示和运行?谢谢以下是我所拥有的:仅有一个的php<?php get_header(); ?> <div id=\"content\">
WP_REGISTER_SIDABAR_WIDGET()取消了我的Widges子菜单--我做错了什么?
将他人制作的主题作为官方职责。起初,它会导致wp admin Widgets页面出错&mdash;根本不起作用。然后我第一个想到的是调试。。。Debugging steps“raquo;已激活WP_DEBUG.“raquo;停用所有插件“raquo;切换到默认主题“T13”。Errors发现问题来自主题。再次激活主题,它在前端和后端都显示了许多调试通知。首先是:register_sidebar_widget() is deprecated.所以我毫不犹豫地去了wp_register_sidebar_wid
如何将特殊的css类传递到小部件li
我已将侧栏分配到functions.php:register_sidebar( array ( \'name\' => \'Footer Widgets Area\', \'id\' => \'footer_widgets_area\', \'description\' => \'Assign Maximum 3 widgets into this footer sid
在使用子主题时,如何覆盖在父主题中注册的侧边栏?
我目前正在使用一个子主题,它的父主题已经注册了侧栏。。我的问题是我想更改父主题的动态侧栏发件人:register_sidebar(array( \'name\' => \'Footer\', \'before_widget\' => \'<div class=\"span3\">\', \'after_widget\' => \'</div>\', \'before_title\' => \'&
Is_active_侧边栏()不起作用
为什么is\\u active\\u sidebar()函数返回的总是false?作用php代码:if ( function_exists(\'register_sidebar\') ) { register_sidebar(array( \'name\' => \'Footer Column 2\', \'id\' => \'footer-column-2\', // I also added the ID but doesn\'t work