<section id="tresc"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class="entry"> <h1 class="blog_header"><strong><a href="<?php echo get_permalink().'#notka';?>"><?php the_title(); ?></a></strong></h1> <p class="entry-date"><?php the_time('d-m-Y'); ?></p> <a href="<?php the_permalink(); ?>"> <?php if ( has_post_thumbnail() ) { the_post_thumbnail( 'single-post', array('class' => 'entry-thumb') ); } ?> </a> <article class="notka"> <?php the_content('czytaj dalej'); ?> </article> <div class="clear"></div> </div> <!-- end entry --> <?php endwhile; else: ?> <p><?php _e('Brak wpisów spełniających żądania.'); ?></p> <?php endif; ?></section>
<?php add_action( 'init', 'register_my_menu' ); function register_my_menu() { register_nav_menu( 'primary-menu', __( 'Primary Menu' ) ); } add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 120, 100 ); add_image_size( 'single-post', 120, 100 ); if ( function_exists('register_sidebar') ) 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widgettitle">', 'after_title' => '</h2>', )); ?>
Ale używając go nie działają mi kategorie, zawsze pojawia się najnowszy wpis. Tylko najnowszy, na podstronach, na głównej i w kategorieach. Co zrobić, żeby kategorie działały, i żeby na głównej wyświetlało się 5 najnowszych wpisów, a dalsze dzielone byłyby na strony?