I posted a comment on Dates on Blog Posts - Should You Have Them? last week over at Problogger.Net on how easy it would be to implement code to a theme which would allow a user to show or hide content based on the date or age of a post. 내 블로그에 날짜에 댓글을 올렸습 게시물 - 당신은 그들이? 지난 일주일 넘게 Problogger.Net에서 했어야되는 건데 방법은 사용자의 콘텐츠를 표시하거나 숨길 수있는 날짜 또는 연령에 따라 테마로 코드를 구현하는 것이 쉽지 게시물의.I’ve since gotten a few emails about this in particular and was going to share this with some of these tricks I had mentioned when I did the redesign of this site last week . 그 이후이 특정에 대해 몇 가지 몇 가지 때 이메일을 오긴했는데, 지난주에이 사이트의 재설계 않았다 언급했다 이러한 트릭이 공유하려고 했어요.
Dates on Recent Posts But Not on Older Ones - I saw one blogger do this last year (I’m afraid I don’t remember who it was).하지만 최근 게시물 이전 건 아니죠에 - 제가 본 한 블로거는이 지난해 (내가 누군지는 기억이 안)에 일정 두려워요.They had hacked WordPress so that dates appeared on recent posts (within the last 3 months) but anything older than that did not have time stamps either on the post or comments. 그들은 워드 그렇게 날짜를 최근 게시물에 대한 마지막 3 개월 ()지만 그 이상 아무것도 게시물이나 댓글 중 하나에 시간이 없었 이전 이내에 등장 우표를 해킹했다.This meant that the blogger benefited from new posts looking new and took the potential distraction of old posts away from readers. 이것은 블로거의 새로운보고에서 새 게시물 혜택과 떨어져 독자 이전 게시물의 잠재력을 끄는했다.I don’t know exactly how the blogger did it but presume they set up a rule that looked at the date of authorship and then determined whether the date would be displayed or not. 제가 정확히 어떻게 그랬지만, 블로거들은 저자의 날짜에서 다음과 모습이 될 것이라고 결정 여부가 표시되지 날짜 또는 규칙을 설정 탁상 모르겠어.
In short, to do this you’ll be modifying your theme (/wp-content/themes/YOURTHEME/ index.php and/or single.php) rather then the core wordpress code. 즉, (/ wp-content/themes/YOURTHEME / index.php 및 / 또는)가 아니라 핵심은 WordPress의 코드를 다음 single.php이 당신의 테마를 수정 할 수있을거야.Also I’m using wordpress 2.6 but this should work on anything wordpress 2.0 or later for sure. 또한 전 2.6을 사용하여 워드 작업을해야 합니다만이 WordPress의 아무것도 2.0 이상이 확실합니다.Anything lower it might work but you might need to redefine $postdate with whatever the_date() function was back then. 아래 아무것도 작동 수도 있지만 () 함수는 무엇 the_date 함께 postdate $ 재정리해야 할 수도있습니다 그때였다.(It may very well be the same). (그것은 아주 잘 동일)가 될 수있습니다.Other then that, its good old PHP that handles it. 그때 그 외,는, 예전의 좋은 PHP는 그것을 처리합니다.
This code must be placed within the loop. 이 코드는 루프 내에 삽입되어야합니다.By that I mean, it needs to be within that if (have_posts())… bit as shown in the code. 에 의해 그 말은, 그것을 가능해야한다면 (have_posts ()) ... 비트로 코드에 표시됩니다.From there we’re grabbing the date using the_date(). 거기에서 우리는 the_date를 사용하여 날짜를 잡을거야 (). You don’t have to use a separate variable for this, but I find it easier because I reference that variable more than once in the code.
Some Uses For Showing & Hiding Content보기 & 콘텐츠를 숨기고에 대한 몇 가지 사용법 Among the uses that users have for this kind of implementation: 사용자가 갖고있는 이런 종류의 구현을 사용하는 중 :
AdSense or other Ads - Showing or hiding Ads on pages only after a certain date.특정 날짜에만 페이지에 애드 센스 또는 다른 광고 -보기 또는 숨어있는 광고.Readers that keep up with your blog and look at all your new posts right away will appreciate this. 독자 여러분의 블로그를 유지하고 귀하의 모든 새 게시물에서 바로이 좋아할 것입니다.They are also your most loyal readers 그들은 또한 가장 충성하는 독자
Social media tags - I’m doing this right now on this site.소셜 미디어 태그 - 지금이 사이트에이 일을 제대로 해요.If the post is older than 20 days, I have it set to display social bookmarking links at the bottom of the post. 경우에는 게시물을 이전보다 20 일, 나는 그것 게시물 하단의 소셜 북마크 링크를 표시하도록 설정했습니다.If its newer, the bar displays at the top. 자사의 최신 경우, 상단에있는 막대를 표시합니다.
Contests - If you have different content you want to display before or after a contest, you can use this method to automate the content switch for you.콘테스트 - 만약 당신의 앞 또는 다른 콘텐츠를 표시하려는 콘테스트 후, 당신에 대한 콘텐츠 스위치를 자동화하기 위해이 방법을 사용할 수있습니다.For example. 예를 들어.Before the contest you could wrap in your form code. 귀하의 양식 코드에 싸다 수 콘테스트 전에.After the contest date(s) end you could wrap in a “sorry, this contest is over” text. s)로하면 "미안에 해결할 수있는 최종 경연 대회 날짜 (후,이 콘테스트는"텍스트입니다.
Resources자원 Template Tags/the date - Wordpress Codex - This is for modifying and understanding the_date() parameters in wordpress’s function.템플릿 태그 / 날짜 - Wordpress Codex 국제 -이 수정과 워드의 기능에 the_date () 매개 변수를 이해하기위한입니다. http://us3.php.net/manual/en/function.mktime.php - This is the function we’re using within the date() function to “generate” a time.http://us3.php.net/manual/en/function.mktime.php - 이것은 우리가 데이트 이내에 사용하는 기능은 무엇입니까 () "는"시간을 생성하는 기능을 수행합니다.Note this time is based on your server time. 이 시간을 참고하여 서버 시간을 기준입니다.Which means if your server time is an hour behind you, you can adjust for that by doing something like this (still assuming the two month string). date(”Ymd”,mktime(date(”h”) 1,0,0,date(”m”)-2,date(”d”),date(”Y”))); . 만약 귀하의 서버 시간이 한시간 뒤에있는, 당신이 (아직 2 개월과 같은 문자열을 가정하고)을 조정할 수있다는 것을 의미한다. 날짜 ( "Ymd", mktime (날짜 ( "H"가) 1,0, 0, 날짜 ( "M"이) -2, 날짜 ( "d"를), 날짜 ( "Y ")));. http://us3.php.net/manual/en/function.date.php - Date function calls/formatting in PHP.http://us3.php.net/manual/en/function.date.php - 날짜 함수를 호출 / PHP에서 서식을 사용합니다.If you want to change the format of the date, this would be a good place to go. 만약 당신이 날짜의 형식을 변경하려면이 가고 좋은 장소가 될 것이다.Just replace the configuration of the Ymd I have in there now to whatever format you want based on the chart shown there. 그냥 Ymd 내가 너를 원하는 차트를 그곳에 따라 표시되는 형식이 무엇을 가지고있어 지금의 구성을 바꿉니다.
Hope that helps! 희망 도움!Questions about this, post below. 이 게시물 아래에 대한 질문.New requests or questions about the way I created this theme please post to the Rob Malon redesigned post . 새 요청하거나이 주제 롭 런에 게시하시기 바랍니다 만든 방법에 대한 질문을 게시하고 재단장을 실시했다.
Rob, great post. 롭, 위대한 게시할 수있습니다.Thanks for the detailed info. 상세한 정보를 주셔서 감사합니다.You can never have too many WordPress theme hacks in your arsenal. 당신의 무기고에 너무 많은 WordPress의 테마를 해킹 가질 수 없어.
Danny Cooper : I have a blog in a very rare niche, most people, around 80%, who search for it...대니 쿠퍼 : 난 아주 드문 틈새 시장에서 블로그가 대부분의 사람들은 누구에 대한 검색의 약 80 %, ...- [Go To Post]- 포스트로 이동 []
Todd : A good point you made by “Make yourself easily reachable.토드 : "로 만들면서 자신을 쉽게 접속할 수 좋은 지적합니다.One of your biggest... 한 너의 최고의 ...- [Go To Post]- 포스트로 이동 []
Way to drive your testing team nuts: Make a form's "Go" button produce different behavior from even/odd cords of where they clicked on it =) 귀하의 테스트 방식으로 팀을 미치게 : 양식의 "이동"버튼도 다른 행동을 생산 /의 이상한 코드를 어디에 =)를 클릭하십시오
@leolaporte Hi Leo =) @ leolaporte 안녕 레오 =)
How I'm making more money from a site that is decreasing in traffic and maintaining the same eCPM & CTR. 내가 어떻게 교통 체증 감소와 같은 유효 CPM & 클릭률을 유지하는 사이트에서 더 많은 돈을 만들고있어.Google Analytics, you lie... Google Analytics는, 당신은 거짓말을 ...
Hmm Lots of affiliate comissions on World Of Warcraft products today. 월드 오브 워크 래프트의 제품에 대한 제휴 수수료의 흠, 오늘 많이했다.You'd never know the new patch just came out =) =)의 새로운 패치가 그냥 나왔 모를거야
Increase your decision-making and complex reasoning abilities by learning google: http://is.gd/43pr 구글 학습하여 결정 -하고 복잡한 추리 능력을 늘리십시오 : http://is.gd/43pr
Its such a fuzzy warm feeling when DNS for a new domain finally resolves to your server. 는 등 따뜻한 느낌을 때 뿌연 마침내 새 도메인에 대한 DNS 서버를 해결합니다.
Making Money Online During A Bad Economy http://tinyurl.com/44b5b2 경제가 나쁘다는 http://tinyurl.com/44b5b2 동안 돈을 온라인으로 만들고
롭, 위대한 게시할 수있습니다. 상세한 정보를 주셔서 감사합니다. 당신의 무기고에 너무 많은 WordPress의 테마를 해킹 가질 수 없어.
좋은 정보