Wsparcie » Używanie i konfiguracja WordPressa » Help, ta sama data i godzina w komentarzach

  • Przy komentarzach jest ta sama data/godzina ich dodania na stronie głównej. Były dodawane o różnych porach i oczywiście od strony admina są różne, gdzie szukać przyczyny złego wyświetlania (zamiast różnych wszędzie 18:01) tu ten blog http://bulowice.pl/?p=40#comments ?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Możemy prosić o pliki single.php i comments.php?

    Thread Starter kozioek

    (@kozioek)

    jasne 🙂
    +++++++++++++++++++++++
    comments.php
    +++++++++++++++++++++++
    <!DOCTYPE HTML PUBLIC „-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>
    <head>
    <?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
    ?>
    </head>
    <body>
    <p class=”nocomments”>Ten wpis jest chroniony hasĹ�em.
    Podaj je, aby móc czyta� komentarze.</p>
    <?php return;
    }
    }

    /* This variable is for alternating comment background */
    $oddcomment = 'class=”alt” ’;
    ?><!– You can start editing here. –>
    <div class=”comments-show”><?php if ($comments) : ?>
    <h3 id=”comments”><?php comments_number(’Brak odpowiedzi’, 'Jedna odpowiedĹş’, 'Odpowiedzi: %’);?>
    do tego wpisu.</h3>
    <ol class=”commentlist”>
    <?php foreach ($comments as $comment) : ?> <li =””><?php echo $oddcomment; ?>id=”comment-<?php comment_ID() ?>”>
    <div class=”comment-gravatar”> <img
    src=”http://www.gravatar.com/avatar.php?gravatar_id=%3C?=md5%28get_comment_author_email%28%29%29?%3E&size=30&#8243;
    alt=”<? comment_author() ?>’s Gravatar” class=”gravatar”>
    </div>
    <div class=”comment-body”>
    <div class=”comment-head”>
    <p>Autor:<?php comment_author_link() ?> dnia<?php the_time(’d.m.y’); ?>
    o godz.<?php the_time(); ?><?php edit_comment_link(’Edytuj’,’  ’,”); ?> </p>
    <?php if ($comment->comment_approved == '0′) : ?>
    <p>TwĂłj komentarz czeka na zatwierdzenie przez
    moderatora.
    </p>
    <?php endif; ?> </div>
    <div class=”comment-text”><?php comment_text() ?> </div>
    </div>

    <?php /* Changes every other comment to a different class */
    $oddcomment = ( empty( $oddcomment ) ) ? 'class=”alt” ’ : ”;
    ?>
    <?php endforeach; /* end for each comment */ ?>

    <?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”>Komentowanie wyĹ�Ä�czone.</p>
    <?php endif; ?><?php endif; ?>
    <?php if (’open’ == $post->comment_status) : ?>
    <h3 id=”respond”>Dodaj swĂłj komentarz</h3>
    <?php if ( get_option(’comment_registration’) && !$user_ID ) : ?>
    <p>Musisz si� <a
    href=”<?php echo get_option(’siteurl’); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>”>zalogowaÄ�
    aby móc komentowa�.</p>
    <?php else : ?>
    <div class=”comment-form”>
    <form
    action=”<?php echo get_option(’siteurl’); ?>/wp-comments-post.php”
    method=”post” id=”commentform”><?php if ( $user_ID ) : ?>
    <p>Zalogowano jako <a
    href=”<?php echo get_option(’siteurl’); ?>/wp-admin/profile.php”><?php echo $user_identity; ?>.
    <a
    href=”<?php echo get_option(’siteurl’); ?>/wp-login.php?action=logout”
    title=”Wyloguj z tego profilu”>Wyloguj »</p>
    <?php else : ?>
    <p><input name=”author” id=”author”
    value=”<?php echo $comment_author; ?>” size=”22″
    tabindex=”1″ type=”text”><label for=”author”><small>ImiÄ�
    <?php if ($req) echo „(wymagane)”; ?></small></label></p>
    <p><input name=”email” id=”email”
    value=”<?php echo $comment_author_email; ?>” size=”22″
    tabindex=”2″ type=”text”>
    <label for=”email”><small>E-mail (bÄ�dzie
    ukryty)<?php if ($req) echo „(wymagany”; ?> </small></label></p>
    <p><input name=”url” id=”url”
    value=”<?php echo $comment_author_url; ?>” size=”22″
    tabindex=”3″ type=”text”>
    <label for=”url”><small>Strona www</small></label></p>
    <?php endif; ?>
    <!–<p><small>XHTML: MoĹźesz uĹźywaÄ� nastÄ�pujÄ�ce tagi: <?php echo allowed_tags(); ?></small></p>–>
    <p><textarea name=”comment” id=”comment”
    cols=”100″ rows=”10″ tabindex=”4″></textarea></p>
    <p><input name=”submit” id=”submit”
    tabindex=”5″ value=”WyĹ�lij komentarz” type=”submit”>
    <input name=”comment_post_ID” value=”<?php echo $id; ?>”
    type=”hidden”></p>
    <?php do_action(’comment_form’, $post->ID); ?>
    </form>
    </div>
    <?php endif; // If registration required and not logged in ?>
    <?php endif; // if you delete this the sky will fall on your head ?></div>
    </body>
    </html>
    ++++++++++++++++++++++++++++
    i
    single.php
    ++++++++++++++++++++++++++++
    <!DOCTYPE HTML PUBLIC „-//W3C//DTD HTML 4.01 Transitional//EN”>
    <html>
    <head>
    <?php get_header() ?><?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?><?php the_time(’j’) ?><?php the_time(’M’) ?><?php the_title(); ?>
    </head>
    <body>
    <div id=”single-content”>
    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <p class=”post-date”> <span class=”date-day”></span>
    <span class=”date-month”></span> </p>
    <h2>” rel=”bookmark”
    title=”StaĹ�y link do wpisu <?php the_title_attribute(); ?>”>
    </h2>
    <p class=”metadata”>Autor:<?php the_author() ?>
    w kategorii:<?php the_category(’, ’); ?> . <span
    class=”feedback”><?php comments_popup_link(’Brak komentarzy’, '1 komentarz’, 'Komentarzy: %’); ?></span><?php edit_post_link(’Edytuj’, ’ | ’, ”); ?></p>
    <div class=”entry”><?php the_content(’Czytaj dalej’); ?> </div>
    </div>
    <?php comments_template() ?><?php endwhile; else : ?>
    <div class=”post”>
    <h2 class=”center”>Nie znaleziono</h2>
    <p class=”center”>Niestety, nie ma tutaj tego, co szukasz.</p>
    <?php include (TEMPLATEPATH . „/searchform.php”); ?> </div>
    <?php endif; ?>
    </div>
    <!– /content –><!– /main –>
    <?php get_sidebar() ?><?php get_footer() ?>
    </body>
    </html>
    +++++++++++++++++++++++++

    Thread Starter kozioek

    (@kozioek)

    i bez błędów:
    single:

    <?php get_header() ?>

    <div id=”single-content”>

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>
    <p class=”post-date”>
    <span class=”date-day”><?php the_time(’j’) ?></span>
    <span class=”date-month”><?php the_time(’M’) ?></span>
    </p>
    <h2>” rel=”bookmark” title=”Stały link do wpisu <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
    <p class=”metadata”>Autor: <?php the_author() ?> w kategorii: <?php the_category(’, ’); ?>. <span class=”feedback”><?php comments_popup_link(’Brak komentarzy’, '1 komentarz’, 'Komentarzy: %’); ?></span><?php edit_post_link(’Edytuj’, ’ | ’, ”); ?></p>
    <div class=”entry”>
    <?php the_content(’Czytaj dalej’); ?>
    </div>
    </div>

    <?php comments_template() ?>

    <?php endwhile; else : ?>
    <div class=”post”>
    <h2 class=”center”>Nie znaleziono</h2>
    <p class=”center”>Niestety, nie ma tutaj tego, co szukasz.</p>
    <?php include (TEMPLATEPATH . „/searchform.php”); ?>
    </div>

    <?php endif; ?>

    </div><!– /content –>

    </div><!– /main –>

    <?php get_sidebar() ?>

    <?php get_footer() ?>

    comments:

    <?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”>Ten wpis jest chroniony hasłem. Podaj je, aby móc czytać komentarze.</p>

    <?php
    return;
    }
    }

    /* This variable is for alternating comment background */
    $oddcomment = 'class=”alt” ’;
    ?>

    <!– You can start editing here. –>

    <div class=”comments-show”>

    <?php if ($comments) : ?>

    <h3 id=”comments”><?php comments_number(’Brak odpowiedzi’, 'Jedna odpowiedź’, 'Odpowiedzi: %’);?> do tego wpisu.</h3>

    <ol class=”commentlist”>

    <?php foreach ($comments as $comment) : ?>

    <li <?php echo $oddcomment; ?>id=”comment-<?php comment_ID() ?>”>
    <div class=”comment-gravatar”>
    <img src=”http://www.gravatar.com/avatar.php?gravatar_id=&lt;?=md5(get_comment_author_email())?>&size=30″ alt=”<? comment_author() ?>’s Gravatar” class=”gravatar” />
    </div>
    <div class=”comment-body”>
    <div class=”comment-head”>
    <p>Autor: <?php comment_author_link() ?> dnia <?php the_time(’d.m.y’); ?> o godz. <?php the_time(); ?><?php edit_comment_link(’Edytuj’,’  ’,”); ?></p>
    <?php if ($comment->comment_approved == '0′) : ?>
    <p>Twój komentarz czeka na zatwierdzenie przez moderatora.</p>
    <?php endif; ?>
    </div>
    <div class=”comment-text”>
    <?php comment_text() ?>
    </div>
    </div>

    <?php
    /* Changes every other comment to a different class */
    $oddcomment = ( empty( $oddcomment ) ) ? 'class=”alt” ’ : ”;
    ?>

    <?php endforeach; /* end for each comment */ ?>

    <?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”>Komentowanie wyłączone.</p>

    <?php endif; ?>
    <?php endif; ?>

    <?php if (’open’ == $post->comment_status) : ?>

    <h3 id=”respond”>Dodaj swój komentarz</h3>

    <?php if ( get_option(’comment_registration’) && !$user_ID ) : ?>
    <p>Musisz się /wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>”>zalogować aby móc komentować.</p>
    <?php else : ?>
    <div class=”comment-form”>
    <form action=”<?php echo get_option(’siteurl’); ?>/wp-comments-post.php” method=”post” id=”commentform”>

    <?php if ( $user_ID ) : ?>

    <p>Zalogowano jako /wp-admin/profile.php”><?php echo $user_identity; ?>. /wp-login.php?action=logout” title=”Wyloguj z tego profilu”>Wyloguj »</p>

    <?php else : ?>

    <p><input type=”text” name=”author” id=”author” value=”<?php echo $comment_author; ?>” size=”22″ tabindex=”1″ />
    <label for=”author”><small>Imię <?php if ($req) echo „(wymagane)”; ?></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>E-mail (będzie ukryty) <?php if ($req) echo „(wymagany”; ?></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>Strona www</small></label></p>

    <?php endif; ?>

    <!–<p><small>XHTML: Możesz używać następujące tagi: <?php echo allowed_tags(); ?></small></p>–>

    <p><textarea name=”comment” id=”comment” cols=”100%” rows=”10″ tabindex=”4″></textarea></p>

    <p><input name=”submit” type=”submit” id=”submit” tabindex=”5″ value=”Wyślij komentarz” />
    <input type=”hidden” name=”comment_post_ID” value=”<?php echo $id; ?>” />
    </p>
    <?php do_action(’comment_form’, $post->ID); ?>

    </form>
    </div>
    <?php endif; // If registration required and not logged in ?>

    <?php endif; // if you delete this the sky will fall on your head ?>

    </div>

    Nie łatwiej byłoby wkleić kod na stronę wklejto.pl i dać tu linki? Tak niewygodnie się czyta kod.

    Thread Starter kozioek

    (@kozioek)

    Już zmieniłem, bo sam zerknąłem w kod – jak komuś się to również przydaży:

    to zmieniłem <?php the_time(’d.m.y’); ?> o godz. <?php the_time(); ?>
    na: <?php comment_time(’d.m.y’); ?> o godz. <?php comment_time(); ?>

    Pozdrawiam
    o dzięki za chęć pomocy 🙂

Viewing 5 replies - 1 through 5 (of 5 total)
  • Temat ‘Help, ta sama data i godzina w komentarzach’ jest zamknięty na nowe odpowiedzi.