需要用到的调用标签:
<?php get_header();?>
<?php get_footer();?>
<?php get_sidebar();?>
获取主页路径:<?php echo get_option(‘home’); ?>
Header.php中用到的标签:
<meta http-equiv=”Content-Type” content=”text/html; charset=<?php bloginfo( ‘charset’ ); ?>” />
<title><?php wp_title(”); ?><?php if(wp_title(”, false)) { echo ‘ | ‘; } ?> <?php bloginfo(‘name’); ?></title>
<?php wp_head(); ?>
设为首页、收藏本站:
<script type=”text/javascript”>
// Bookmark
function bookmark(title, url) {
if (document.all)
window.external.AddFavorite(url, title);
else if (window.sidebar)
window.sidebar.addPanel(title, url, “”)
}
</script>
<div style=”float:right”> <a href=”#” onClick=”this.style.behavior=’url(#default#homepage)’;this.setHomePage(‘<?php bloginfo(‘url’); ?>’);” class=”homepage”>设为首页</a> | <a href=”#” onClick=”javascript:bookmark(‘<?php bloginfo(‘name’); ?>’,'<?php bloginfo(‘url’); ?>’);” target=”_blank” class=”favicon”>加为收藏</a></div>
自定义css的导航调用方法:
<?php
$args=array(
‘orderby’ => ‘id’,
‘order’ => ‘ASC’
);
$categories=get_categories($args);
foreach($categories as $category) {
echo ‘<li class=”thisclass”><a href=”‘ . get_category_link( $category->term_id ) . ‘” title=”‘ . sprintf( __( “View all posts in %s” ), $category->name ) . ‘” ‘ . ‘>’ . $category->name.'</a></li>’;
}
?>
日期向右靠齐:
<div style=”float:right”></div>
如何添加全站链接:
<a href=” <?php echo get_option(‘home’); ?>”>全站链接1</a>
原文链接:https://i.haogew.cn/182.html,转载请注明出处~~~
评论0