• Opgelost MyUtd4Life

    (@myutd4life)


    Beste mede-WordPress gebruikers,

    Ik zit met een vervelend probleem. Graag wil ik de reacties netjes ordenen op pagina’s van 10 reacties met de recentste reacties op de (eerste) standaard pagina die wordt weergeven (pagina 1).

    Hoewel de opties goed staan ingesteld bij instellingen neemt mijn theme deze niet automatisch over. Ik hoop echt dat iemand mij kan helpen om dit te repareren.

    <?php // Do not delete these lines
    	if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    		die ('Please do not load this page directly. Thanks!');
    
    	if (!empty($post->post_password)) { // if there's a password
    		if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) {  // and it doesn't match the cookie
    			?>
    
    			<p class="nocomments">Dit artikel is beveiligd met een wachtwoord. Vul het wachtwoord in om door te gaan.</p>
    
    			<?php
    			return;
    		}
    	}
    
    	/* This variable is for alternating comment background */
    	$oddcomment = 'class="alt" ';
    ?>
    
    <?php if ($comments) : ?><br /><br />
    
    <?php echo $comments_list; ?>
    
    <div class="datum"><h4>Reacties (<?php comments_number('0', '1', '%' );?>)</h4></div><br />
    <?php /* <div class="datum"><h3 id="comments"><?php comments_number('Geen reacties', '1 reactie', '% reacties' );?> op “<?php the_title(); ?>”</h3></div> */ ?>
    
    	<ol class="commentlist">
    
    	<?php foreach ($comments as $comment) : ?>
    
    		<li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>">
    			<cite><?php if(function_exists('get_avatar')){ echo get_avatar($comment, '75'); } ?><h3 id="comments"><?php comment_author_link() ?></h3></cite>
    			<?php if ($comment->comment_approved == '0') : ?>
    			<em>Je reactie is nog niet goedgekeurd.</em>
    			<?php endif; ?>
    
    			<small class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('l j F Y') ?> om <?php comment_time('H:i') ?></a> <?php edit_comment_link('(Reactie bewerken)','&nbsp;&nbsp;<i>','</i>'); ?><hr /></small>
    			<?php comment_text() ?>
    
    		</li>
    
    	<?php
    		/* Changes every other comment to a different class */
    		$oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : '';
    	?>
    
    	<?php endforeach; /* end for each comment */ ?>
    
    	</ol>
    
     <?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"></p>
    
    	<?php endif; ?>
    <?php endif; ?>
    
    <?php if ('open' == $post->comment_status) : ?>
    
    <h3 id="respond">Reageren</h3>
    
    <?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()); ?>">inloggen</a> om te kunnen reageren.</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 get_option('siteurl'); ?>/wp-login.php?action=logout" title="Uitloggen">Uitloggen &raquo;</a></p>
    
    <?php else : ?>
    
    <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" />
    <label for="author"><small>Name <?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" />
    <label for="email"><small>Mail (will not be published) <?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><div class="commentform"><textarea name="comment" id="comment" cols="100%" rows="10" tabindex="4"></textarea><?php cs_print_smilies() ?></div></p>
    
    <p><input name="submit" type="submit" id="submit" tabindex="5" value="Post reactie" />
    <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
    </p>
    <?php do_action('comment_form', $post->ID); ?>
    
    </form>
    
    <br /><br />
    <?php endif; // If registration required and not logged in ?>
    
    <?php endif; // if you delete this the sky will fall on your head ?>

    Verder maak ik gebruik van TinyMCEComments om de textarea aan te vullen, maar ik verwacht dat dit niks uitmaakt voor de indeling.

    Alvast bedankt!

3 reacties aan het bekijken - 1 tot 3 (van in totaal 3)
  • Uit welk bestand komt dit?

    Dit is niet je comments.php file of wel ???

    Want je mist een stuk code.

    <?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
    			<div class="navigation">
    				<div class="nav-previous"><?php previous_comments_link( __( '<span class="meta-nav">&larr;</span> Older Comments', 'twentyten' ) ); ?></div>
    				<div class="nav-next"><?php next_comments_link( __( 'Newer Comments <span class="meta-nav">&rarr;</span>', 'twentyten' ) ); ?></div>
    			</div> <!-- .navigation -->
    <?php endif; // check for comment navigation ?>

    Dat is het menu dat je nodig hebt om het te tonen.
    Maar ik kan zo niet zeggen of je dit er zomaar in kan zetten omdat de code die je geeft niet standaard is en er al een hoop aan gedaan is.

    Thread starter MyUtd4Life

    (@myutd4life)

    Komt inderdaad uit comments.php, ik denk eerlijk gezegd niet dat je dit zomaar ergens in je code kan zetten aangezien er twentyten in staat.

    Thread starter MyUtd4Life

    (@myutd4life)

    Verholpen door de plugin Paginated Comments te installeren en die naar wens aan te passen;)

3 reacties aan het bekijken - 1 tot 3 (van in totaal 3)
  • Het onderwerp ‘Reacties nemen instelling van WordPress niet over’ is gesloten voor nieuwe reacties.