Как отобразить дату публикации на странице со статьей

zonar
На сайте с 24.05.2009
Offline
165
768

Работаю с WP

В шаблоне нет такой фишки чтобы дата публикации отображалась.

Шаблон хороший и поэтому менять не хочу.

Но для работы в ротапосте необходимо чтобы дата отображалась.

Какой плагин можно применить для этого?

Городской дневник ( https://youtu.be/k2qZdPXHoYY )
S3
На сайте с 18.04.2011
Offline
109
#1

вывод даты <span class="postDate"><?php echo get_the_date('') ?> | </span>

horrors
На сайте с 02.04.2010
Offline
53
#2

А вот есть различные вариации функции the_date

zonar
На сайте с 24.05.2009
Offline
165
#3
sok3535:
вывод даты <span class="postDate"><?php echo get_the_date('') ?> | </span>

Я в пхп не силен. Куда это вставлять?

horrors
На сайте с 02.04.2010
Offline
53
#4
zonar:
Я в пхп не силен. Куда это вставлять?

В нужном месте шаблона (index.php, single.php и т.д.)

S3
На сайте с 18.04.2011
Offline
109
#5

single.php код покажите - куда-нить воткнем)

zonar
На сайте с 24.05.2009
Offline
165
#6
sok3535:
single.php код покажите - куда-нить воткнем)

<?php

global $options;

foreach ($options as $value) {

if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; } else { $$value['id'] = get_settings( $value['id'] ); }

}

$dateformat = get_option('date_format');

$timeformat = get_option('time_format');

?>

<?php get_header(); ?>

<?php

// post custom fields

$template = get_post_meta($post->ID, 'wpzoom_post_template', true);

$showsocial = get_post_meta($post->ID, 'wpzoom_post_social', true);

$showauthor = get_post_meta($post->ID, 'wpzoom_post_author', true);

?>

<div id="frame">

<div id="content">

<div class="wrapper">

<div id="main">

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

<div id="single">

<div class="title breadcrumbs">

<?php echo '<h3>'; wpzoom_breadcrumbs(); echo'</h3>'; ?>

</div><!-- end .title -->

<div class="box box-single">

<h1 class="title"><?php the_title(); ?></h1>

<div class="cleaner">&nbsp;</div>

<div class="postcontent">

<?php the_content(); ?>

<div style='float: left; width:69%'><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div>

<div style='float: right; width:29%'>Статью прочли <?php if(function_exists('the_views')) { the_views(); } ?></div>

</div>

<div class="cleaner">&nbsp;</div>

</div><!-- end .box -->

<?php comments_template(); ?>

<div class="related"><h3>Раньше в этом разделе:</h3><?php

$categories = get_the_category($post->ID);

if ($categories) {

$category_ids = array();

foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;

$args=array(

'category__in' => $category_ids,

'post__not_in' => array($post->ID),

'showposts'=>3,

'caller_get_posts'=>1

);

$my_query = new wp_query($args);

if( $my_query->have_posts() ) {

echo '<ul>';

while ($my_query->have_posts()) {

$my_query->the_post();

?><li><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title2('', '...', true, '33') ?></a>

<div class="clear"></div><?php if ( function_exists( 'cim_the_thumb' ) ) { cim_the_thumb('thumbnail'); } ?>

<?php the_content_limit(400, ''); ?></li>

<?php

}

echo '</ul>';

}

wp_reset_query();

} ?></div><div class="clear"> </div>

</div><!-- end #single -->

<div class="cleaner">&nbsp;</div>

<?php endwhile; else: ?>

<p><?php _e('Sorry, no posts matched your criteria', 'wpzoom');?>.</p>

<?php endif; ?>

</div><!-- end #main -->

<div id="sidebar">

<?php get_sidebar(); ?>

</div><!-- end #sidebar -->

<div class="cleaner">&nbsp;</div>

</div><!-- end .wrapper -->

</div><!-- end #content -->

</div><!-- end #frame -->

<?php get_footer(); ?>

S3
На сайте с 18.04.2011
Offline
109
#7

перед этим тегом например <div class="title breadcrumbs"> или после него

zonar
На сайте с 24.05.2009
Offline
165
#8

Всем спасибо за помощь. Получилось.

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий