2014-09-09 2 views
0

사용자 정의 테마를 실행중인 My WordPress 블로그는 오늘 각 게시물의 날짜를 같은 날짜로 표시합니다. 내 메인 홈 페이지의 마지막 세 게시물을 표시하지만 그 날짜는 괜찮습니다. 그러나 내 메인 블로그 페이지에는 모든 게시물의 현재 날짜가 표시됩니다.WordPress 블로그 날짜가 모든 게시물의 현재 날짜를 표시합니다.

내 사이트에 FTP로 접속할 수 있고 모든 PHP 파일에 액세스 할 수 있습니다. 문제는 index.php, page.php, single이든이 오류가 있을지 모릅니다. .php, 나는 모른다. 누구든지 문제가있는 곳을 제안 할 수 있으면 해당 코드를 공유하여 도움을받을 수 있습니다.

는 여기에 내가 테마 템플릿 태그를 사용하는 경우가 the_time 기능을 이용해야하는 경우, the_date 기능을 사용하고 거의 확실 해요 index.php를

<?php 

get_header(); ?> 
<div class="wrap blog"> 
<h1>Blog</h1> 
<div class="blog-left"> 
<div id="main-content" class="main-content"> 

<?php 
if (is_front_page() && twentyfourteen_has_featured_posts()) { 
    // Include the featured content template. 
    get_template_part('featured-content'); 
} 
?> 

<div id="primary" class="content-area"> 
    <div id="content" class="site-content" role="main"> 

    <?php 
     if (have_posts()) : 
      // Start the Loop. 
      while (have_posts()) : the_post(); 

       /* 
       * Include the post format-specific template for the content. If you want to 
       * use this in a child theme, then include a file called called content-___.php 
       * (where ___ is the post format) and that will be used instead. 
       */ 
       get_template_part('content', get_post_format()); 

      endwhile; 
      // Previous/next post navigation. 
      twentyfourteen_paging_nav(); 

     else : 
      // If no content, include the "No posts found" template. 
      get_template_part('content', 'none'); 

     endif; 
    ?> 


    </div><!-- #content --> 
</div><!-- #primary --> 
<?php get_sidebar('content'); ?> 
</div><!-- #main-content --> 
</div> 

<div class="blog-right"> 
<?php get_sidebar(); ?> 
</div> 
</div> 
<?php 
get_footer(); 
+0

당신이 코드를 추가 할 수 있습니다 .PHP 특별한 포스트 형식, 내용 -의 {형식}의 content.php 또는 경우에? –

+0

thats 문제는, 나는 그 코드가 어디 있을지 모르겠다 .... 나는 단순히 내 페이지에 최신 10 개의 게시물을 표시하는 일반 -> 설정 아래에 충돌, 그리고 워드 프레스 않습니다. 하지만 잘못된 날짜를 표시하는 것입니다 ... – user3688814

+0

'index_php' 파일을 추가하려고합니다.'have_post' 함수를 호출하는 동안'while' 내부에있는 부분을 추가하십시오. –

답변

1

템플릿 계층 차트를보고 해당 게시물을 표시하는 데 사용되는 파일을 확인하십시오. 주제와 설정에 따라 archive.php, front-page.php, home.php, index.php 일 수 있습니다. 거기에서 함수 또는 각 게시물의 내용을 표시하기 위해로드 된 파일을 볼 수 있습니다. 샘플 코드를 고려

, 그 아마

+0

당신이 옳았어요! 그것은 content.php에 있었고, echo date에서 echo the_time ('F, Y'); – user3688814

1

입니다.

the_date에 대한 문서를 읽을 수 있습니다. 설명에는 읽어야 할 참고 사항이 있습니다.

+0

당신은 아마 어떤 템플릿 파일이 호출되고/어떤 파일을 가지고 있니? – user3688814

+0

나는 그것이 그것을 도왔다, 도움받는 조언을 위해 thx! – user3688814