Facebook
From oliwka, 6 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 312
  1. function
  2.  
  3.  
  4. <?php
  5.  
  6. function register_my_menus() {
  7.  
  8.   register_nav_menus(
  9.  
  10.     array(
  11.  
  12.       'poziome-menu-test' => __( 'Poziome menu testowe' ),
  13.       'pionowe-menu-test' => __( 'Pionowe menu testowe' )
  14.     )
  15.  
  16.   );
  17.  
  18. }
  19.  
  20. add_action( 'init', 'register_my_menus' );
  21. add_theme_support( 'post-thumbnails' );
  22. set_post_thumbnail_size( 658, 370 );
  23. add_image_size( 'post-icon', 658, 370, true );
  24. ?>
  25.  
  26.  
  27. **************************************
  28.  index.php
  29.  
  30. <!DOCTYPE html>
  31. <html>
  32. <?php wp_head(); ?>
  33.  
  34. <head>
  35.     <title>
  36.         <?php wp_title(); ?>
  37.         <?php bloginfo('name'); ?>
  38.     </title>
  39.     <meta charset="UTF-8" />
  40.     <link rel="stylesheet" href="<?php bloginfo( 'stylesheet_url' ); ?>" type="text/css" />
  41.     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  42.     <script>
  43.         for (var e, l = 'footer header nav article section aside figure'.split(' '); e = l.pop(); document.createElement(e));
  44.  
  45.     </script>
  46. </head>
  47. <?php wp_footer(); ?>
  48.  
  49. <body>
  50.     <header class="web">
  51.         <!--LOGO-->
  52.         <div class="logo">
  53.             <a href="<?php bloginfo( 'home' ); ?>">
  54.                     <img src="<?=get_template_directory_uri(); ?>/images/logo.png" alt="logo Test.Matfiz24.pl" />
  55.                 </a>
  56.         </div>
  57.  
  58.         <!--WYSZUKIWARKA-->
  59.         <form class="szukaj" action="<?php bloginfo('url'); ?>" method="get" accept-charset="utf-8">
  60.             <fieldset>
  61.                 <input name="s" type="text" placeholder="Szukaj..." value="<?php the_search_query(); ?>" /><input type="submit" value="Szukaj" />
  62.             </fieldset>
  63.         </form>
  64.         <div class="clearfix"></div>
  65.         <div class="clearfix"></div>
  66.  
  67.         <!--MENU POZIOME-->
  68.         <nav>
  69.             <?php wp_nav_menu( array( 'theme_location' => 'poziome-menu-test', 'depth' => 2)); ?>
  70.         </nav>
  71.     </header>
  72.     <div class="clearfix"></div>
  73.  
  74.     <div class="web">
  75.         <section>
  76.             <!--WPISY-->
  77.             <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  78.  
  79.             <article>
  80.                 <h1>
  81.                     <a href="<?php the_permalink(); ?>">
  82.                         <?php the_title(); ?>
  83.                     </a>
  84.                 </h1>
  85.                 <a href="<?php the_permalink(); ?>">
  86.                     <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'post-icon') ; } ?>
  87.                 </a>
  88.                 <?php the_content('czytaj dalej'); ?>
  89.             </article>
  90.  
  91.             <?php endwhile; else: ?>
  92.  
  93.             <p>
  94.                 <?php _e('Sorry, no posts matched your criteria.'); ?>
  95.             </p>
  96.  
  97.             <?php endif; ?>
  98.         </section>
  99.  
  100.         <!--SIDEBAR-->
  101.         <aside>
  102.             <h2>SEKCJE</h2>
  103.             <nav>
  104.                 <?php wp_nav_menu( array( 'theme_location' => 'pionowe-menu-test', 'depth' => 2)); ?>
  105.             </nav>
  106.         </aside>
  107.         <div class="clearfix"></div>
  108.     </div>
  109.  
  110.     <!--FOOTER-->
  111.     <footer class="web">
  112.         &copy; 2015 Test.MatFiz24.pl
  113.     </footer>
  114. </body>
  115.  
  116. </html>
  117.  
  118.  
  119. ************************
  120.  
  121. style.css
  122.  
  123. /* Theme Name: motyw */
  124.  
  125. * {
  126.     margin: 0;
  127.     padding: 0;
  128. }
  129.  
  130. body {
  131.     font-family: Arial, Tahoma, sans-serif;
  132.     font-size: 15px;
  133. }
  134.  
  135. header,
  136. footer,
  137. nav,
  138. section,
  139. article,
  140. aside,
  141. hgroup {
  142.     display: block;
  143. }
  144.  
  145. fieldset,
  146. img {
  147.     outline: none;
  148.     border: none;
  149.     margin: 0;
  150.     padding: 0;
  151. }
  152.  
  153. a {
  154.     color: #2c5c88;
  155.     text-decoration: none;
  156. }
  157.  
  158. a:hover {
  159.     color: #F39130;
  160. }
  161.  
  162. p {
  163.     margin: 0 0 10px 0;
  164. }
  165.  
  166. .clearfix {
  167.     clear: both;
  168. }
  169.  
  170. .web {
  171.     width: 960px;
  172.     margin: 0 auto;
  173. }
  174.  
  175. header .logo {
  176.     float: left;
  177.     padding: 10px 0;
  178. }
  179.  
  180. header form {
  181.     float: right;
  182.     padding: 25px 0;
  183. }
  184.  
  185. header form input[name=s] {
  186.     height: 35px;
  187.     width: 160px;
  188.     padding-left: 5px;
  189.     outline: none;
  190.     border: 1px solid #58585A;
  191.     border-radius: 7px 0 0 7px;
  192.     color: #31323d;
  193. }
  194.  
  195. header form input[type=submit] {
  196.     height: 39px;
  197.     outline: none;
  198.     width: 80px;
  199.     font-weight: 700;
  200.     background: #58585A;
  201.     color: #FFF;
  202.     border-radius: 0 7px 7px 0;
  203.     cursor: pointer;
  204.     border: none;
  205. }
  206.  
  207. header nav {
  208.     background: url(images/tlo_menu.png) repeat-x;
  209.     height: 46px;
  210. }
  211.  
  212. header nav ul,
  213. .web aside ul {
  214.     list-style: none;
  215. }
  216.  
  217. header nav ul li a {
  218.     color: black;
  219.     display: block;
  220.     float: left;
  221.     padding: 0 18px;
  222.     line-height: 46px;
  223. }
  224.  
  225. header nav ul li a:hover {
  226.     color: #FFF;
  227.     background: #F39130;
  228. }
  229.  
  230. .web section {
  231.     width: 700px;
  232.     float: left;
  233.     margin-top: 10px;
  234. }
  235.  
  236. .web section article {
  237.     border: 1px solid #e9e9e9;
  238.     padding: 20px;
  239.     border-radius: 20px;
  240.     margin-bottom: 10px;
  241. }
  242.  
  243. .web section article h1 {
  244.     margin: 0 0 10px 0;
  245.     padding: 5px 10px;
  246.     font-size: 25px;
  247. }
  248.  
  249. a.more-link {
  250.     display: block;
  251.     background: #2c5c88;
  252.     color: #FFF;
  253.     width: 100px;
  254.     padding: 10px 25px;
  255.     border-radius: 5px;
  256.     text-align: center;
  257. }
  258.  
  259. a.more-link:hover {
  260.     background: #F39130;
  261. }
  262.  
  263. .web aside {
  264.     width: 240px;
  265.     margin-top: 10px;
  266.     float: right;
  267. }
  268.  
  269. .web aside h2 {
  270.     background: #2a669e;
  271.     color: white;
  272.     padding: 10px;
  273.     font-size: 15px;
  274. }
  275.  
  276. .web aside nav {
  277.     margin-bottom: 10px;
  278. }
  279.  
  280. .web aside nav ul li:first-child a {
  281.     border-top: 1px solid #e9e9e9;
  282. }
  283.  
  284. .web aside nav ul li a {
  285.     border-left: 1px solid #e9e9e9;
  286.     border-right: 1px solid #e9e9e9;
  287.     border-bottom: 1px solid #e9e9e9;
  288.     display: block;
  289.     background: url(images/punktor_menu.png) 20px center no-repeat;
  290.     padding: 10px 35px;
  291. }
  292.  
  293. .web aside nav ul li a:hover {
  294.     text-decoration: underline;
  295. }
  296.  
  297. footer {
  298.     color: #FFF;
  299.     background: grey;
  300.     line-height: 40px;
  301.     text-align: center;
  302. }
  303.  
  304. /*RESPONSIVE*/
  305.  
  306. @media all and (max-width: 959px) {
  307.     .web {
  308.         width: 100%;
  309.     }
  310.  
  311.     header .logo {
  312.         float: none;
  313.         text-align: center;
  314.     }
  315.  
  316.     header form {
  317.         display: none;
  318.     }
  319.  
  320.     .web section {
  321.         float: none;
  322.         width: 100%;
  323.     }
  324.  
  325.     .web section img {
  326.         width: 100%;
  327.         height: 100%;
  328.     }
  329.  
  330.     .web aside {
  331.         float: none;
  332.         width: 100%;
  333.     }
  334. }
  335.  
  336.  **************************