Wsparcie » Zaawansowane » Brak komentarzy we własnym theme

  • Ostatnio zacząłem robić pod WordPressa 3.4 własny styl. Wszystko szło okej, dopóki nie zauważyłem, że komentarze pod postami się po prostu nie wyświetlają. Kombinowałem na wiele sposobów, ale żaden z nich nie przyniósł oczekiwanego przeze mnie efektu…
    Poniżej zamieszczam kod z single.php, functions.php oraz comments.php.

    single.php

    <?php get_header(); ?>
    
    	<div id="blog">
    		<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    
    		<div class="post">
    		<span style="font-size: 22px; color: #425e6a;"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
    
    			<div class="entry">
    				<span style="color: gray; float: left; margin-right: 10px; font-size: 9px; margin-top: 4px; margin-bottom: 7px;">Data publikacji: <?php the_date('Y-m-d'); ?></span>
    				<span style="color: gray; float: right; margin-right: 10px; font-size: 9px; margin-top: 4px; margin-bottom: 7px;"><?php _e('Kategoria:'); ?> <?php the_category(', ') ?></span><br />
    				<?php the_post_thumbnail(); ?>
    				<?php the_content(); ?>
    
    				<p class="postmetadata">
    				<div class="badge">
    				<?php comments_popup_link('Brak komentarzy', '1 komentarz', '% komentarzy'); ?><?php edit_post_link('Edytuj', '  ', ''); ?>
    				</div>
    				</p>
    
    			</div>
    
    			<div class="comments-template">
    				<h2>Co o tym myślisz?</h2>
    					<?php comments_template(); ?>
    			</div>
    
    	</div>
    
    <?php endwhile; ?>
    
    	<div class="navigation">
    		<?php previous_post_link('< %link') ?> <?php next_post_link(' %link >') ?>
    	</div>
    
    <?php endif; ?>
    </div>
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    functions.php

    <?php
    //Widgety w sidebarze
    if ( function_exists('register_sidebar') )
        register_sidebar();
    
    //Wsparcie dla własnych 'menu' w WordPressie 3.0
    add_action( 'init', 'register_my_menu' );
    
    //Własne menu
    function register_my_menu() {
    	register_nav_menu( 'primary-menu', __( 'Primary Menu' ) );
    }
    
    //Własne tło
    add_custom_background();
    
    // Miniaturki w postach
    add_theme_support('post-thumbnails');
    set_post_thumbnail_size(520, 250, true);
    ?>

    comments.php
    <?php comment_form(); ?>

    I wygląda to w ten sposób: http://michalwroblewski.com.pl/img/comments.png

    Liczę na pomoc!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • Temat ‘Brak komentarzy we własnym theme’ jest zamknięty na nowe odpowiedzi.