本文整理汇总了PHP中get_sidebars函数的典型用法代码示例。如果您正苦于以下问题:PHP get_sidebars函数的具体用法?PHP get_sidebars怎么用?PHP get_sidebars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_sidebars函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_template_part
</div><?php
}
}
} else {
get_template_part('post', 'noresults');
}
if ($is_post_wrap == '1') {
?>
</div><?php
}
get_template_part('navigation');
?>
<?php
$theme->hook('content_after');
?>
</div><!-- #content -->
<?php
get_sidebars();
?>
<?php
$theme->hook('main_after');
?>
</div><!-- #main -->
<?php
get_footer();
示例2: get_sidebars
</div><!-- #content-wrap -->
<div id="primary-sidebar-wrap" class="span-8 last">
<?php
get_sidebars('primary');
?>
</div><!-- #primary-sidebar-wrap -->
</div><!-- #main -->
<?php
get_footer();
示例3: get_template_part
* Learn more about the get_template_part() function: http://codex.wordpress.org/Function_Reference/get_template_part
*/
$is_post_wrap++;
if ($is_post_wrap == '1') {
?>
<div><?php
}
get_template_part('post', 'homepage');
if ($is_post_wrap == '2') {
$is_post_wrap = 0;
?>
</div><?php
}
}
} else {
get_template_part('post', 'noresults');
}
?>
</div>
</td>
<td>
<div style="float:right">
<?php
get_sidebars(null);
?>
</div>
</td>
</tr>
</table>
<?php
get_footer();
示例4: admin_page
function admin_page()
{
?>
<script>
function remove_sidebar_link(name,num){
answer = confirm("Are you sure you want to remove " + name + "?\nThis will remove any widgets you have assigned to this sidebar.");
if(answer){
//alert('AJAX REMOVE');
remove_sidebar(name,num);
}else{
return false;
}
}
function add_sidebar_link(){
var sidebar_name = prompt("Sidebar Name:","");
//alert(sidebar_name);
add_sidebar(sidebar_name);
}
</script>
<div class="wrap">
<h2>Sidebars</h2>
<br />
<table class="widefat page" id="sbg_table" style="width:600px;">
<tr>
<th>Sidebar Name</th>
<th>CSS class</th>
<th>Remove</th>
</tr>
<?php
$sidebars = get_sidebars();
//$sidebars = array('bob','john','mike','asdf');
if (is_array($sidebars) && !empty($sidebars)) {
$cnt = 0;
foreach ($sidebars as $sidebar) {
$alt = $cnt % 2 == 0 ? 'alternate' : '';
?>
<tr class="<?php
echo $alt;
?>
">
<td><?php
echo $sidebar;
?>
</td>
<td><?php
echo name_to_class($sidebar);
?>
</td>
<td><a href="javascript:void(0);" onclick="return remove_sidebar_link('<?php
echo $sidebar;
?>
',<?php
echo $cnt + 1;
?>
);" title="Remove this sidebar">remove</a></td>
</tr>
<?php
$cnt++;
}
} else {
?>
<tr>
<td colspan="3">No Sidebars defined</td>
</tr>
<?php
}
?>
</table><br /><br />
<div class="add_sidebar">
<a href="javascript:void(0);" onclick="return add_sidebar_link()" title="Add a sidebar" class="button-primary">+ Add New Sidebar</a>
</div>
</div>
<?php
}
示例5: wp_get_header
<?php
wp_get_header();
?>
<div class="span-24" id="contentwrap">
<?php
get_sidebars('left');
?>
<div class="span-14">
<div id="content">
<h2 class='pagetitle'>Error 404 - Page Not Found</h2>
</div>
</div>
<?php
get_sidebars('right');
?>
</div>
<?php
wp_get_footer();