ładny header w WP
Przykład jak można zamieścić header w WP:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title><?php if (is_home () ) { bloginfo('name'); } elseif ( is_category() ) { single_cat_title(); echo " - "; bloginfo('name'); } elseif (is_single() || is_page() ) { single_post_title(); } elseif (is_search() ) { bloginfo('name'); echo " search results: "; echo wp_specialchars($s); } else { wp_title('',true); } ?></title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<meta name="robots" content="index,follow"/>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="shortcut icon" href="<?php bloginfo('template_url');?>/images/favicon.ico" />
<!-- general, normalize, reset -->
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen"/>
<!-- fonts -->
<link rel="stylesheet" href="<?php bloginfo('template_url');?>/css/stylesheetfonts.css" type="text/css">
<!-- styles -->
<link rel="stylesheet/less" type="text/css" href="<?php bloginfo('template_url');?>/css/styles.less">
<script src="http://lesscss.googlecode.com/files/less-1.0.30.min.js"></script>
<!-- scrypts -->
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="<?php bloginfo('template_url');?>/js/myscript.js"></script>
<?php include (TEMPLATEPATH . '/a-header.php'); ?>
<?php wp_head(); ?>
</head>
<body class="<?php echo custom_body_class(); ?>">
<div id="page" class="wrapper cfix">
<!-- header -->
<header id="mainheader" class="container cfix">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo get_bloginfo ('description');?>" class="logo"><img src="<?php bloginfo('template_url');?>/images/logo.png" alt="<?php echo get_bloginfo ('description');?>" /></a>
<h1><?php bloginfo( 'name' ); ?></h1>
</header><!-- //header -->
</div>
–
home_url()
site_url()
esc_url()
esc_attr()
esc_html()
Hope this helps and happy coding :)
Zobacz jeszcze
wyróżnienie drugiego wyrazu w zdaniu
- $('h1').each(function(){ var text = $(this).text().split(' '); if(text.length < 2) return; text = '<span>' +text+ '</span>'; $(this).html(...