Ondersteuning » Algemeen WordPress » probleem met reacties in custom template design

  • Hallo aan iedereen die dit leest,

    Voor alle duidelijkheid: Ik ben een newbee in WordPress
    Ik heb een set templates gemaakt voor technischblog.nl, deels vorlgens eht boek “WordPress Theme Design”, maar boeken kun je nooit 1 op 1 overnemen in de praktijk, dus ik loop tegen het volgende aan:

    Ik krijg het niet voor elkaar om de bug uit mijn reactiepagina te verhelpen. Als ik vanuit mijn homepage (technischblog.nl) klik op

    No Comments »

    dan komt de pagina erna er zo uit te zien: http://technischblog.nl/geen-categorie/test-artikel-technischblog.html#respond

    Zoals je kunt zien wordt de post herhaald en ook al heb ik het hele script van

    comments.php

    gekopieerd in de div waar ook de post zelf stond, de tekst komt bovenaan de pagina te staan en als ik op source klik komt de tekst zelfs boven <html> te staan in de code.

    Wat doe ik fout en hoe kan ik dit herstellen?

    de code van de links in de indexpagina:
    ` <p class=”postmetadata”>
    <?php the_tags(‘Tags: ‘, ‘, ‘, ‘
    ‘); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?>
    </p>`

    en de code van mijn comments.php

    <head>
    <style type="text/css" media="screen">
    
    @import url("<?php bloginfo('stylesheet_url'); ?>");
    
    .style1 {font-size: 0.85em}
    </style>
    </head>
    <body>
    <div id="mainContainer">
    		<div id="siteContainer">
            <?php get_header(); ?>
            	<div id="header">
           	  </div><!--//logo-->
    
    			<div id="mainContent">
                <div id="leftColumn">
                <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    // Do not delete these lines
    	if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Please do not load this page directly. Thanks!');
    
    	if ( post_password_required() ) { ?>
    		<p class="nocomments">Dit bericht is beveiligd met een wachtwoord. Reageren kan alleen door een wachtwoord in te vullen</p>
    	<?php
    		return;
    	}
    ?>
    
         <?php if ( have_comments() ) : ?>
    	<h3 id="comments"><?php comments_number('Geen Reacties', 'Een reactie op', '% Reacties' );?> to “<?php the_title(); ?>”</h3>
    
    	<div class="navigation">
    		<div class="alignleft"><?php previous_comments_link() ?></div>
    		<div class="alignright"><?php next_comments_link() ?></div>
    	</div>
    
    	<ol class="commentlist">
    	<?php wp_list_comments(); ?>
    	</ol>
    
    	<div class="navigation">
    		<div class="alignleft"><?php previous_comments_link() ?></div>
    		<div class="alignright"><?php next_comments_link() ?></div>
    	</div>
     <?php else : // this is displayed if there are no comments so far ?>
    
    	<?php if ('open' == $post->comment_status) : ?>
    		<!-- If comments are open, but there are no comments. -->
    
    	 <?php else : // comments are closed ?>
    		<!-- If comments are closed. -->
    		<p class="nocomments">Reacties zijn gesloten</p>
    
    	<?php endif; ?>
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    
    <div id="respond">
    
    <h3 id="comments"><?php comment_form_title( 'Reageer', 'Reageer op %s' ); ?></h3>
    
    <div class="cancel-comment-reply">
    	<small><?php cancel_comment_reply_link(); ?></small>
    </div>
    
    <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
    <p>Je moet <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">ingelogd zijn </a> om een reactie te plaatsen.</p>
    <?php else : ?>
    
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p>Ingelogd als<a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account">Uitloggen &raquo;</a></p>
    
    <?php else : ?>
    
    <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="author"><small>Naam <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
    <label for="email"><small>Mail (niet publiek) <?php if ($req) echo "(required)"; ?></small></label></p>
    
    <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
    <label for="url"><small>Website</small></label></p>
    
    <?php endif; ?>
    
    <!--<p><small><strong>XHTML:</strong> You can use these tags: <code><?php echo allowed_tags(); ?></code></small></p>-->
    
    <p><textarea name="comment" id="comment" cols="48" rows="10" tabindex="4"></textarea></p>
    
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
    <?php comment_id_fields(); ?>
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <?php endif; // If registration required and not logged in ?>
    </div>
    
    <?php endif; // if you delete this the sky will fall on your head ?>
    
                </div>
                <!--//leftColumn-->
    
                <div id="rightColumn">
      			<?php include(TEMPLATEPATH . '/sidebar2.php'); ?>
                </div>
                 <!--//RightColumn-->
    
                <div id="sidebar">
    
    <?php get_sidebar(); ?>
    
                </div>
                <div id="pushBottom"></div>
       			<div id="footer">
    <?php get_footer(); ?>   			</div>
         		<!--//footer-->
    
              </div>
                <!--//mainContent-->
    
                     <ul id="navMainMenu">
                     <li><a href="index.php">Home</a></li>
                  	<?php wp_list_pages('title_li=' ); ?>
                    </ul>
                    <!--//mainMenu-->
      		</div>
      <!--//siteContainer-->
    
    </div>
           <!--//siteContainer-->
    
    </body>
  • Het onderwerp ‘probleem met reacties in custom template design’ is gesloten voor nieuwe reacties.