Skip to content

Instantly share code, notes, and snippets.

@ddksr
Created June 5, 2015 05:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddksr/06b74b29e6f70db06e0d to your computer and use it in GitHub Desktop.
Save ddksr/06b74b29e6f70db06e0d to your computer and use it in GitHub Desktop.

Uvod

  • [x] predstavi se
  • [x] prilagajanje wp-ja: teme in plugini. razlika?
    • [x] actions
    • [x] filters
    • [x] the loop

Teme

  • [x] style.php - metapodatki teme
  • [x] functions.php - programerske nastavitve teme
    • [x] poglej featured image
  • [x] osnovno ogrodje
  • [x] get_header(), get_footer()
  • [x] have_posts(), the_post(), the_* …
    • [x] http://localhost/wp/?s=hello, http://localhost/wp/?s=donava

Naloga

  • [x] Dodaj featured image v predlogo

Datoteke

style.css

/*
    Theme Name: Gorgonzola
    Theme URI: https://ninja.com
    Author: Žiga Stopinšek
    Author URI: https://sigi.stopinsek.eu
    Description: Življenje in skili mlade ninje
    Version: 0.1
    Tags: ninja, skili, responsive, learning
*/

span.time {
	font-style: italic;
	font-weight: bold; 
}

ul.post-categories {
	list-style-type: none;
	display: inline-block;
	padding: 0;
	margin: 0; 
}


ul.post-categories li {
	display: inline-block; 
}

functions.php

<?php
add_theme_support( 'post-thumbnails' );

index.php

<?php get_header(); ?>

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ) : ?>
    <?php the_post_thumbnail('thumbnail'); ?>
<?php endif; ?>
    <h2><?php the_title() ;?></h2>
	<div>
		<span class="time"><?php echo the_time(); ?></span>, Kategorije: <?php echo the_category(); ?>
	</div>
    <?php the_content(); ?>
<?php endwhile; else : ?>
    <p>Trenutno ne najdem vsebin</p>
<?php endif; ?>

<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment