Spokojnych, zdrowych, radosnych świąt Bożego Narodzenia
spędzonych w serdecznym gronie rodzinnym.
spędzonych w serdecznym gronie rodzinnym.
Niechaj tegoroczne piękne Święta przyniosą betlejemski blask wszystkim Wam.
Grafika komputerowa i wszystko co kręci się wokół grafiki oraz projektowania stron internetowych, poprzetykane moimi ostatnimi rysunkami.
<?php get_header(); ?>
<div id="container">
<div id="content">
<!-- #content, główny kontent strony -->
</div>
</div><!-- #container -->
<div id="primary" class="widget-area">
</div><!-- #primary .widget-area -->
<div id="secondary" class="widget-area">
</div><!-- #secondary -->
<?php get_footer(); ?>
Za chwilę opiszę jak uzupełnić powyższy szkielet o elementy które sprawią że stanie się on w pełni funkcjonalny.
<?php while ( have_posts() ) : the_post() ?> <?php the_content(); ?> <?php endwhile; ?>
<?php the_title('<h1>', '</h1>'); ?>
<h1><?php the_title(); ?></h1>
$args = array(
'before' => '<p>' . __('Pages:'),
'after' => '</p>',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'number',
'nextpagelink' => __('Next page'),
'previouspagelink' => __('Previous page'),
'pagelink' => '%',
'echo' => 1
);
<?php
wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=Strona %');
?>
<div class="art-meta">
<span class="author">Autor: <?php the_author_link(); ?></span>, Opublikowano:
<span class="data"><?php the_time('Y-m-d H:i:s') ?> </span>
<?php edit_post_link( "Edytuj post" ) ?>
</div>
<?php get_header(); ?>
<div id="container"><!-- #container -->
<div id="content"> <!-- #content, główny kontent strony -->
<?php while ( have_posts() ) : the_post() ?>
<?php the_title('<h1>', '</h1>'); ?>
<div class="art-meta">
<span class="author">Autor: <?php the_author_link(); ?></span>, Opublikowano:
<span class="data"><?php the_time('Y-m-d H:i:s') ?> </span>
<?php edit_post_link( "Edytuj post" ) ?>
</div>
<?php the_content(); ?>
<div class="link-pages">
<?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=Strona %'); ?>
</div>
<?php endwhile; ?>
</div> <!-- #content, główny kontent strony -->
</div><!-- #container -->
<div id="primary" class="widget-area">
</div><!-- #primary .widget-area -->
<div id="secondary" class="widget-area">
</div><!-- #secondary -->
<?php get_footer(); ?>
W ciele szablonu index.php umieściliśmy poprzednio także wywołania funkcji które ładują nam nagłówek oraz stopkę. Wydaje się, że zapomnieliśmy o bocznych paskach które będziemy wyświetlać na naszej stronie. Czas najwyższy naprawić to zaniedbanie. Użyjemy w tym celu funkcji get_sidebar(). Ale to już w kolejnym odcinku naszej serii ...
</div><!-- #main --> <div id="footer"> <!-- stopka --> <div id="footer-inner"><!-- #footer-inner, wewnętrzny kontener stopki --> <div id="footer-info"> <!-- #footer-info --> </div> </div><!-- #footer-inner --> </div><!-- #footer --> </div> </body> </html>Podobnie jak nagłówek stopkę uzupełnimy o kilka informacji dynamicznie generowanych przez środowisko WordPress. U góry stopki umieścimy link do strony głównej, bo linków wewnętrznych nigdy nie jest za wiele:)
<?php wp_list_pages('include=1,5,8&title_li=' ); ?>
<?php $args = array(
// parametry => wartosci domyślne parametrów
'depth' => 0,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 0,
'exclude' => '',
'include' => '',
'title_li' => __('Pages'),
'echo' => 1,
'authors' => '',
'sort_column' => 'menu_order, post_title',
'link_before' => '',
'link_after' => '',
'walker' => '',
'post_type' => 'page',
'post_status' => 'publish'
); ?>
</div><!-- #main -->
<div id="footer"> <!-- stopka -->
<div id="footer-inner"><!-- #footer-inner, wewnętrzny kontener stopki -->
<p>
<a href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>">
<?php bloginfo('name'); ?>
</a> jest blogiem o ...
</p>
<ul class="footerlinks">
<?php wp_list_pages('title_li='); ?>
</ul>
<ul class="footerlinks">
<?php wp_list_categories('title_li='); ?>
</ul>
<div id="footer-info">
<!-- #footer-info -->
Copyright by © Windroos
</div>
</div><!-- #footer-inner -->
</div><!-- #footer -->
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<div id="container">
<div id="header"><!-- nagłówek -->
<div id="header-inner"><!-- wewnętrzny kontener nagłówka -->
<div id="firma">
<!-- #logo, miejsce na logo, znak firmowy itp -->
</div>
<div id="nav">
<!-- #nav, nawigacja górna -->
</div>
</div> <!-- #header-inner -->
</div><!-- #header -->
<div id="main">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<title><?php
if ( is_single() ) { single_post_title(); }
elseif ( is_home() || is_front_page() ) {
bloginfo('name'); print '. '; bloginfo('description'); }
elseif ( is_page() ) { single_post_title(''); }
elseif ( is_search() ) {
bloginfo('name'); print '. Wyniki wyszukiwania dla '.esc_html($s); }
elseif ( is_404() ) { bloginfo('name'); print '. Nie znaleziono'; }
else { bloginfo('name');}
?></title>
<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>;
charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="description" content="<?php bloginfo('description'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script('comment-reply'); ?>
<?php wp_head(); ?>
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>"
title="<?php printf( 'Ostatnie posty z %s', esc_html( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>"
title="<?php printf('Ostatnie komentarze z %s', esc_html( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
</head>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<title><?php
if ( is_single() ) { single_post_title(); }
elseif ( is_home() || is_front_page() ) { bloginfo('name'); print '. '; bloginfo('description'); }
elseif ( is_page() ) { single_post_title(''); }
elseif ( is_search() ) { bloginfo('name'); print '. Wyniki wyszukiwania dla '.esc_html($s); }
elseif ( is_404() ) { bloginfo('name'); print '. Nie znaleziono'; }
else { bloginfo('name');}
?></title>
<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="description" content="<?php bloginfo('description'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>"
title="<?php printf('Ostatnie posty z %s', esc_html( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>"
title="<?php printf('Ostatnie komentarze z %s', esc_html( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
</head>
<body>
<div id="container">
<div id="header"><!-- nagłówek -->
<div id="header-inner"><!-- wewnętrzny kontener nagłówka -->
<div id="firma">
<!-- #logo, miejsce na logo, znak firmowy itp -->
</div>
<div id="nav">
<!-- #nav, nawigacja górna -->
</div>
</div> <!-- #header-inner -->
</div><!-- #header -->
<div id="main">
<div id="firma">
<?php if ( !is_home() && !is_front_page() ) { ?>
<div id="home-link">
<a href="<?php bloginfo( 'url' ) ?>" title="<?php bloginfo( 'name' ) ?>" rel="home">
<?php bloginfo( 'name' ) ?>
</a>
</div>
<?php } ?>
</div>
wp_page_menu(array( 'menu_class' => 'page-navi', 'sort_column' => 'menu_order' ));
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<title><?php
if ( is_single() ) { single_post_title(); }
elseif ( is_home() || is_front_page() ) { bloginfo('name'); print '. '; bloginfo('description'); }
elseif ( is_page() ) { single_post_title(''); }
elseif ( is_search() ) { bloginfo('name'); print '. Wyniki wyszukiwania dla '.esc_html($s); }
elseif ( is_404() ) { bloginfo('name'); print '. Nie znaleziono'; }
else { bloginfo('name');}
?></title>
<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="description" content="<?php bloginfo('description'); ?>" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>"
title="<?php printf('Ostatnie posty z %s', esc_html( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>"
title="<?php printf('Ostatnie komentarze z %s', esc_html( get_bloginfo('name'), 1 ) ); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
</head>
<body>
<div id="container">
<div id="header"><!-- nagłówek -->
<div id="header-inner"><!-- wewnętrzny kontener nagłówka -->
<div id="firma">
<?php if ( !(is_home() || is_front_page()) ) { ?>
<div id="home-link">
<a href="<?php bloginfo( 'url' ) ?>" title="<?php bloginfo( 'name' ) ?>" rel="home">
<?php bloginfo( 'name' ) ?>
</a>
</div>
<?php } ?>
</div>
<div id="nav">
<?php wp_page_menu(array( 'menu_class' => 'page-navi', 'sort_column' => 'menu_order' )); ?>
</div>
</div> <!-- #header-inner -->
</div><!-- #header -->
<div id="main">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<div id="container">
<div id="header"><!-- nagłówek -->
<div id="header-inner"><!-- wewnętrzny kontener nagłówka -->
<div id="firma">
<!-- #logo, miejsce na logo, znak firmowy itp -->
</div>
<div id="nav">
<!-- #nav, nawigacja górna -->
</div>
</div> <!-- #header-inner -->
</div><!-- #header -->
<div id="main">
<div id="container">
<div id="content">
<!-- #content, główny kontent strony -->
</div>
</div><!-- #container -->
<div id="primary" class="widget-area">
</div><!-- #primary .widget-area -->
<div id="secondary" class="widget-area">
</div><!-- #secondary -->
</div><!-- #main -->
<div id="footer"> <!-- stopka -->
<div id="footer-inner"><!-- #footer-inner, wewnętrzny kontener stopki -->
<div id="footer-info">
<!-- #footer-info -->
</div>
</div><!-- #footer-inner -->
</div><!-- #footer -->
</div>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body>
<div id="container">
<div id="header"><!-- nagłówek -->
<div id="header-inner"><!-- wewnętrzny kontener nagłówka -->
<div id="firma">
<!-- #logo, miejsce na logo, znak firmowy itp -->
</div>
<div id="nav">
<!-- #nav, nawigacja górna -->
</div>
</div> <!-- #header-inner -->
</div><!-- #header -->
<div id="main">
</div><!-- #main -->
<div id="footer"> <!-- stopka -->
<div id="footer-inner"><!-- #footer-inner, wewnętrzny kontener stopki -->
<div id="footer-info">
<!-- #footer-info -->
</div>
</div><!-- #footer-inner -->
</div><!-- #footer -->
</div>
</body>
</html>
<div id="container">
<div id="content">
<!-- #content, główny kontent strony -->
</div>
</div><!-- #container -->
<div id="primary" class="widget-area">
</div><!-- #primary .widget-area -->
<div id="secondary" class="widget-area">
</div><!-- #secondary -->
<?php get_header(); ?>
<div id="container">
<div id="content">
<!-- #content, główny kontent strony -->
</div>
</div><!-- #container -->
<div id="primary" class="widget-area">
</div><!-- #primary .widget-area -->
<div id="secondary" class="widget-area">
</div><!-- #secondary -->
<?php get_footer(); ?>