• Witam ,

    Mam dość ciekawy problem do rozwiązania. Potrzebuje odczepić od
    <div> comment-meta , obiekt <a> który odpowiada za edycję komentarza.
    Następnie ten element <a> przenieść do <div> "reply" gdzie znajduje się <a> odpowiedzialny za przycisk wyslania komentarza.
    Oczywiścię div comment-meta zostaje na swoim miejscu.

    Podejrzewam że problem może być ze strukturą w comments.php.
    Chciałbym zmienić tryb wyświetlania komentarzy i poustawiać wszystko jak mi pasuję .W google szukałem kilka tutoriali na temat : customization comments in wordpress , ale niczego z tego nie rozumiem.
    Chciałbym stworzyć własną listę komentarzy , i zrobić pola :
    1)góra lewo : avatar
    2)góra prawo obok avatara : godzina , data
    3)pod avatarem : nazwa uzytkownika
    4)Pod godziną i datą <div> lub <p> z treścią komentarza
    5)na dole pasek z przyciskami: edycja , like , odpowiedź.

    Na screenie widać że struktóra jest prawię gotowa ale element edycja jest zagniezdzony w comment-meta i nie wiem jak go wsadzic do div reply

    Screen : LINK
    comments.php :

    <?php
    if ( post_password_required() ) {
    	return;
    }
    ?>
    
    <div id="comments" class="comments-area">
    
    	<?php if ( have_comments() ) : ?>
    	<?php if ( ! comments_open() ) : ?>
    	<p class="no-comments"><?php _e( 'Comments are closed.', 'twentyfourteen' ); ?></p>
    	<?php endif; ?>
    
    			<div id="comment_respond">
    			<div id="comment_info_block"><?php echo get_wp_user_avatar(); ?>
    <p><?php $user_info = get_userdata(1);
          echo 'Użytkownik : ' . $user_info->user_login . "\n";
    ?></p></div>
    			<?php comment_form(array(
    					'comment_notes_after' => '',
    					'comment_field' => '<textarea placeholder="Dodaj jakiś komentarz" id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea>',
    					'logged_in_as' => '',
    					'label_submit' => __( 'Skomentuj' ),
    					'title_reply' => __( '' )
    			)); ?></div>
    
    	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    	<nav id="comment-nav-above" class="navigation comment-navigation" role="navigation">
    		<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1>
    		<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div>
    		<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div>
    	</nav><!-- #comment-nav-above -->
    	<?php endif; // Check for comment navigation. ?>
    
    	<ol class="comment-list">
    		<?php
    			wp_list_comments( array(
    				'style'      => 'or',
    				'short_ping' => true,
    				'avatar_size'=> 52,
    			) );
    		?>
    	</ol><!-- .comment-list -->
    
    	<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : ?>
    	<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
    		<h1 class="screen-reader-text"><?php _e( 'Comment navigation', 'twentyfourteen' ); ?></h1>
    		<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'twentyfourteen' ) ); ?></div>
    		<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'twentyfourteen' ) ); ?></div>
    	</nav><!-- #comment-nav-below -->
    	<?php endif; // Check for comment navigation. ?>
    
    	<?php endif; // have_comments() ?>
    
    </div><!-- #comments -->

    style.css :

    .comments-area {
    	margin: 0px auto;
    	width:100%;
    	padding: 0 10px;
    }
    
    .comment-reply-title,
    .comments-title {
    	font: 900 16px/1.5 Lato, sans-serif;
    	margin: 0;
    	text-transform: uppercase;
    }
    
    .comment-list {
    	list-style: none;
    	margin: 0 0 48px 0;
    }
    
    .comment-author {
    	font-size: 14px;
    	line-height: 1.7142857142;
    }
    
    .comment-list .reply,
    .comment-metadata {
    	font-size: 12px;
    	line-height: 2;
    	text-transform: uppercase;
    }
    
    .comment-list .reply {
    	margin-top: 24px;
    }
    
    .comment-author .fn {
    	font-weight: 900;
    }
    
    .comment-author a {
    	color: #2b2b2b;
    }
    
    .comment-list .trackback a,
    .comment-list .pingback a,
    .comment-metadata a {
    	color: #767676;
    }
    
    .comment-author a:hover,
    .comment-list .pingback a:hover,
    .comment-list .trackback a:hover,
    .comment-metadata a:hover {
    	color: #41a62a;
    }
    
    .comment-list article,
    .comment-list .pingback,
    .comment-list .trackback {
    	border-top: 1px solid rgba(0, 0, 0, 0.1);
    	margin-bottom: 24px;
    	padding-top: 24px;
    }
    
    .comment-list > li:first-child > article,
    .comment-list > .pingback:first-child,
    .comment-list > .trackback:first-child {
    	border-top: 0;
    }
    
    .comment-author {
    	position: relative;
    }
    
    .bypostauthor > article .fn:before {
    	content: "\f408";
    	margin: 0 2px 0 -2px;
    	position: relative;
    	top: -1px;
    }
    
    .says {
    	display: none;
    }
    
    .comment-author,
    .comment-awaiting-moderation,
    .comment-content,
    .comment-list .reply,
    .comment-metadata {
    }
    
    .comment-edit-link {
    	color:#999;
    	font-weight:300;
    	font-family: Segoe UI, Verdana, Geneva, sans-serif;
    	text-align:center;
    	font-size:14px;
    	border-radius:5px;
    	padding:5px 10px;
    	background-color:#fbfbfb;
    	border:1px solid #e5e5e5;
    	float:right;
    }
    .comment-edit-link:before {
    	float:left;
        content:url(../img/edit.png);
    }
    .reply{
    text-align:right;
    }
    .comment-reply-link {
    	color:#999;
    	font-weight:300;
    	font-family: Segoe UI, Verdana, Geneva, sans-serif;
    	text-align:center;
    	font-size:14px;
    	border-radius:5px;
    	padding:5px 10px;
    	background-color:#fbfbfb;
    	border:1px solid #e5e5e5;
    
    }
    .comment-reply-link:before{
        content:url(../img/replay.png);
    
    }
    .comment-reply-login:before {
    }
    
    .comment-content {
    	-webkit-hyphens: auto;
    	-moz-hyphens:    auto;
    	-ms-hyphens:     auto;
    	hyphens:         auto;
    	word-wrap: break-word;
    }
    
    .comment-content ul,
    .comment-content ol {
    	margin: 0 0 24px 22px;
    }
    
    .comment-content li > ul,
    .comment-content li > ol {
    	margin-bottom: 0;
    }
    
    .comment-content > :last-child {
    	margin-bottom: 0;
    }
    
    .comment-list .children {
    	list-style: none;
    	margin-left: 15px;
    }
    /* Okno dodawania komentarzy */
    .comment-respond {
    	display:inline-table;
    	width: 70%;
    }
    .comment-respond form{
    margin-top:-5px;
    }
    .comment-respond textarea{
    	width:100%;
    }
    #comment_respond {
    	margin-bottom:20px;
    	border:1px solid #e5e5e5;
    }
    #comment_info_block {
    text-align:left;
    display:inline-table;
    width:15%;
    }
    #comment_info_block img{
    padding:5px;
    border:1px solid #e5e5e5;
    }
    /* Koniec Okna dodawania komentarzy */
    .comment .comment-respond {
    	margin-top: 24px;
    }
    
    .comment-respond h3 {
    	margin-top: 0;
    	margin-bottom: 24px;
    }
    
    .comment-notes,
    .comment-awaiting-moderation,
    .logged-in-as,
    .no-comments,
    .form-allowed-tags,
    .form-allowed-tags code {
    	color: #767676;
    }
    
    .comment-notes,
    .comment-awaiting-moderation,
    .logged-in-as {
    	font-size: 14px;
    	line-height: 1.7142857142;
    }
    
    .no-comments {
    	font-size: 16px;
    	font-weight: 900;
    	line-height: 1.5;
    	margin-top: 24px;
    	text-transform: uppercase;
    }
    .comment-form label {
    	display: block;
    }
    
    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"] {
    	width: 100%;
    }
    
    .form-allowed-tags,
    .form-allowed-tags code {
    	font-size: 12px;
    	line-height: 1.5;
    }
    
    .required {
    	color: #c0392b;
    }
    .comment-reply-title {
    padding:0px;
    margin:0px;
    content:none;
    }
    .comment-reply-title small a {
    	color: #2b2b2b;
    	float: right;
    	height: 24px;
    	overflow: hidden;
    	width: 24px;
    }
    
    .comment-reply-title small a:hover {
    	color: #41a62a;
    }
    
    .comment-reply-title small a:before {
    	content: "\f405";
    	font-size: 32px;
    }
    
    .comment-navigation {
    	font-size: 12px;
    	line-height: 2;
    	margin-bottom: 48px;
    	text-transform: uppercase;
    }
    
    .comment-navigation .nav-next,
    .comment-navigation .nav-previous {
    	display: inline-block;
    }
    
    .comment-navigation .nav-previous a {
    	margin-right: 10px;
    }
    
    #comment-nav-above {
    	margin-top: 36px;
    	margin-bottom: 0;
    }
    /* Lista Komentarzy */
    .comment-body {
    text-align:left;
    border:1px solid #e5e5e5;
    }
    .comment-author {
    display:inline-table;
    width: 7%;
    float:left;
    text-align:center;
    margin:8px;
    }
    .comment-author img {
    float:left;
    padding:5px;
    border:1px solid #e5e5e5;
    }
    .comment-meta , .commentmetadata{
    width:85%;
    display:inline-table;
    margin:8px;
    }
    .comment-body p {
    display:inline-table;
    width:90%;
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • Temat ‘Problem w Komentarzach’ jest zamknięty na nowe odpowiedzi.