- function
- <?php
- function register_my_menus() {
- register_nav_menus(
- array(
- 'poziome-menu-test' => __( 'Poziome menu testowe' ),
- 'pionowe-menu-test' => __( 'Pionowe menu testowe' )
- )
- );
- }
- add_action( 'init', 'register_my_menus' );
- add_theme_support( 'post-thumbnails' );
- set_post_thumbnail_size( 658, 370 );
- add_image_size( 'post-icon', 658, 370, true );
- ?>
- **************************************
- index.php
- <!DOCTYPE html>
- <html>
- <?php wp_head(); ?>
- <head>
- <title>
- <?php wp_title(); ?>
- <?php bloginfo('name'); ?>
- </title>
- <meta charset="UTF-8" />
- <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
- <script>
- for (var e, l = 'footer header nav article section aside figure'.split(' '); e = l.pop(); document.createElement(e));
- </script>
- </head>
- <?php wp_footer(); ?>
- <body>
- <header class="web">
- <!--LOGO-->
- <div class="logo">
- <a href="<?php bloginfo( 'home' ); ?>">
- <img src="<?=get_template_directory_uri(); ?>/images/logo.png" alt="logo Test.Matfiz24.pl" />
- </a>
- </div>
- <!--WYSZUKIWARKA-->
- <form class="szukaj" action="<?php bloginfo('url'); ?>" method="get" accept-charset="utf-8">
- <fieldset>
- <input name="s" type="text" placeholder="Szukaj..." value="<?php the_search_query(); ?>" /><input type="submit" value="Szukaj" />
- </fieldset>
- </form>
- <div class="clearfix"></div>
- <div class="clearfix"></div>
- <!--MENU POZIOME-->
- <nav>
- <?php wp_nav_menu( array( 'theme_location' => 'poziome-menu-test', 'depth' => 2)); ?>
- </nav>
- </header>
- <div class="clearfix"></div>
- <div class="web">
- <section>
- <!--WPISY-->
- <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
- <article>
- <h1>
- <a href="<?php the_permalink(); ?>">
- <?php the_title(); ?>
- </a>
- </h1>
- <a href="<?php the_permalink(); ?>">
- <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'post-icon') ; } ?>
- </a>
- <?php the_content('czytaj dalej'); ?>
- </article>
- <?php endwhile; else: ?>
- <p>
- <?php _e('Sorry, no posts matched your criteria.'); ?>
- </p>
- <?php endif; ?>
- </section>
- <!--SIDEBAR-->
- <aside>
- <h2>SEKCJE</h2>
- <nav>
- <?php wp_nav_menu( array( 'theme_location' => 'pionowe-menu-test', 'depth' => 2)); ?>
- </nav>
- </aside>
- <div class="clearfix"></div>
- </div>
- <!--FOOTER-->
- <footer class="web">
- © 2015 Test.MatFiz24.pl
- </footer>
- </body>
- </html>
- ************************
- style.css
- /* Theme Name: motyw */
- * {
- margin: 0;
- padding: 0;
- }
- body {
- font-family: Arial, Tahoma, sans-serif;
- font-size: 15px;
- }
- header,
- footer,
- nav,
- section,
- article,
- aside,
- hgroup {
- display: block;
- }
- fieldset,
- img {
- outline: none;
- border: none;
- margin: 0;
- padding: 0;
- }
- a {
- color: #2c5c88;
- text-decoration: none;
- }
- a:hover {
- color: #F39130;
- }
- p {
- margin: 0 0 10px 0;
- }
- .clearfix {
- clear: both;
- }
- .web {
- width: 960px;
- margin: 0 auto;
- }
- header .logo {
- float: left;
- padding: 10px 0;
- }
- header form {
- float: right;
- padding: 25px 0;
- }
- header form input[name=s] {
- height: 35px;
- width: 160px;
- padding-left: 5px;
- outline: none;
- border: 1px solid #58585A;
- border-radius: 7px 0 0 7px;
- color: #31323d;
- }
- header form input[type=submit] {
- height: 39px;
- outline: none;
- width: 80px;
- font-weight: 700;
- background: #58585A;
- color: #FFF;
- border-radius: 0 7px 7px 0;
- cursor: pointer;
- border: none;
- }
- header nav {
- background: url(images/tlo_menu.png) repeat-x;
- height: 46px;
- }
- header nav ul,
- .web aside ul {
- list-style: none;
- }
- header nav ul li a {
- color: black;
- display: block;
- float: left;
- padding: 0 18px;
- line-height: 46px;
- }
- header nav ul li a:hover {
- color: #FFF;
- background: #F39130;
- }
- .web section {
- width: 700px;
- float: left;
- margin-top: 10px;
- }
- .web section article {
- border: 1px solid #e9e9e9;
- padding: 20px;
- border-radius: 20px;
- margin-bottom: 10px;
- }
- .web section article h1 {
- margin: 0 0 10px 0;
- padding: 5px 10px;
- font-size: 25px;
- }
- a.more-link {
- display: block;
- background: #2c5c88;
- color: #FFF;
- width: 100px;
- padding: 10px 25px;
- border-radius: 5px;
- text-align: center;
- }
- a.more-link:hover {
- background: #F39130;
- }
- .web aside {
- width: 240px;
- margin-top: 10px;
- float: right;
- }
- .web aside h2 {
- background: #2a669e;
- color: white;
- padding: 10px;
- font-size: 15px;
- }
- .web aside nav {
- margin-bottom: 10px;
- }
- .web aside nav ul li:first-child a {
- border-top: 1px solid #e9e9e9;
- }
- .web aside nav ul li a {
- border-left: 1px solid #e9e9e9;
- border-right: 1px solid #e9e9e9;
- border-bottom: 1px solid #e9e9e9;
- display: block;
- background: url(images/punktor_menu.png) 20px center no-repeat;
- padding: 10px 35px;
- }
- .web aside nav ul li a:hover {
- text-decoration: underline;
- }
- footer {
- color: #FFF;
- background: grey;
- line-height: 40px;
- text-align: center;
- }
- /*RESPONSIVE*/
- @media all and (max-width: 959px) {
- .web {
- width: 100%;
- }
- header .logo {
- float: none;
- text-align: center;
- }
- header form {
- display: none;
- }
- .web section {
- float: none;
- width: 100%;
- }
- .web section img {
- width: 100%;
- height: 100%;
- }
- .web aside {
- float: none;
- width: 100%;
- }
- }
- **************************