رفتن به مطلب

مشکل در نشان دادن تاریخ مطالب


saeedsaeed

پست های پیشنهاد شده

کد مربوط به صفحه index.php

<?php global $theme; get_header(); ?>
<div id="main">

<?php $theme->hook('main_before'); ?>
<div id="content">

<?php $theme->hook('content_before'); ?>

<?php
if (have_posts()) : while (have_posts()) : the_post();
/**
* The default post formatting from the post.php template file will be used.
* If you want to customize the post formatting for your homepage:
*
* - Create a new file: post-homepage.php
* - Copy/Paste the content of post.php to post-homepage.php
* - Edit and customize the post-homepage.php file for your needs.
*
* Learn more about the get_template_part() function: http://codex.wordpress.org/Function_Reference/get_template_part
*/
get_template_part('post', 'homepage');

endwhile;

else :
get_template_part('post', 'noresults');
endif;

get_template_part('navigation');
?>

<?php $theme->hook('content_after'); ?>

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

<?php get_sidebars(); ?>

<?php $theme->hook('main_after'); ?>

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

<?php get_footer(); ?>

لینک به ارسال

این صفحه ها رو نداره فکر کنم این باشه

<?php if (  $wp_query->max_num_pages > 1 ) { ?>
<div class="navigation clearfix">

<?php
if(function_exists('wp_pagenavi')) {
wp_pagenavi();
} else {
?><div class="alignleft"><?php next_posts_link( __( '<span>«</span> Older posts', 'themater' ) );?></div>
<div class="alignright"><?php previous_posts_link( __( 'Newer posts <span>»</span>', 'themater' ) );?></div><?php
} ?>

</div><!-- .navigation -->

<?php } ?>

یا این

<?php global $theme; ?>

<div <?php post_class('post page clearfix'); ?> id="post-<?php the_ID(); ?>">
<h2 class="title"><?php the_title(); ?></h2>

<?php if(is_user_logged_in()) { ?>
<div class="postmeta-primary"><span class="meta_edit"><?php edit_post_link(); ?></span></div>
<?php } ?>

<div class="entry clearfix">

<?php
if(has_post_thumbnail()) {
the_post_thumbnail(
array($theme->get_option('featured_image_width_single'), $theme->get_option('featured_image_height_single')),
array("class" => $theme->get_option('featured_image_position_single') . " featured_image")
);
}
?>

<?php
the_content('');
wp_link_pages( array( 'before' => '<p><strong>' . __( 'Pages:', 'themater' ) . '</strong>', 'after' => '</p>' ) );
?>
</div>

</div><!-- Page ID <?php the_ID(); ?> -->

لینک به ارسال

با توضیحات موجود در لینک ارسال شده در پست دوم به احتمال زیاد درست میشه.اگه درست نشد،توی فایل های single.php یا home.php یا index.php و هر جایی که از توابع تاریخ استفاده شده دنبال کد date یا the_date بگردید.

  • امتیاز 1
لینک به ارسال

با توضیحات موجود در لینک ارسال شده در پست دوم به احتمال زیاد درست میشه.اگه درست نشد،توی فایل های single.php یا home.php یا index.php و هر جایی که از توابع تاریخ استفاده شده دنبال کد date یا the_date بگردید.

تغییر دادم نشد توی این date iهست

<?php global $theme; ?>
<div <?php post_class('post post-single clearfix'); ?> id="post-<?php the_ID(); ?>">

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

<?php
if(has_post_thumbnail()) {
the_post_thumbnail(
array($theme->get_option('featured_image_width_single'), $theme->get_option('featured_image_height_single')),
array("class" => $theme->get_option('featured_image_position_single') . " featured_image")
);
}
?>

<div class="postmeta-primary">
<span class="meta_date"><?php echo get_the_date(); ?></span>
  <span class="meta_categories"><?php the_category(', '); ?></span>
<?php if(is_user_logged_in()) {
?>   <span class="meta_edit"><?php edit_post_link(); ?></span><?php
} ?>
</div>

<div class="entry clearfix">

<?php
the_content('');
wp_link_pages( array( 'before' => '<p><strong>' . __( 'Pages:', 'themater' ) . '</strong>', 'after' => '</p>' ) );
?>

</div>

<?php if(get_the_tags()) {
?><div class="postmeta-secondary"><span class="meta_tags"><?php the_tags('', ', ', ''); ?></span></div><?php
}
?>


</div><!-- Post ID <?php the_ID(); ?> -->

<?php
if(comments_open( get_the_ID() )) {
comments_template('', true);
}
?>

ویرایش شده توسط saeedsaeed
لینک به ارسال

یک ت به ابتدای date در


<?php echo get_the_date(); ?>

اضافه کنید و تست کنید ، به این صورت :


<?php echo get_the_jdate(); ?>

  • امتیاز 3
لینک به ارسال

این تابع رو جایگزین کنید


<?php the_time('j M, Y'); ?>

ممنون درست شد فقط یه مشکل دیگه هست توی ادامه مطلب درسته ولی صفحه اصلی نه

ویرایش شده توسط saeedsaeed
لینک به ارسال

لطفا برای ارسال دیدگاه وارد شوید

شما بعد از اینکه وارد حساب کاربری خود شدید می توانید دیدگاهی ارسال کنید



ورود به حساب کاربری
×
×
  • اضافه کردن...