Cara Menampilkan Recent Post di WordPress Tanpa Widget

10 Juni 13

Baiklah ini adalah awal dari bangun di masa hibernasi, yang udah ntah berapa lama tidak pegang blog lagi.
Setiap kali saya membuat tema worpress sering memanggil postingan terakhir untuk ditampilkan di sidebar pada halaman baca sebuah posting. Biasanya untuk menampilkan postingan terakhir tersebut saya menggunakan query_post dan memasukkan kategorinya dengan looping yang biasa digunakan di wordpress.
Ternyata pada saat saya membuka kembali blog ini saya menemukan script bawaan dari codex untuk menampilkan recent post yang tidak melalui plugin, widget atau query post tapi cukup gunakan script berikut.

<?php $args = array(
    'numberposts' => 10,
    'offset' => 0,
    'category' => 0,
    'orderby' => 'post_date',
    'order' => 'DESC',
    'include' => ,
    'exclude' => ,
    'meta_key' => ,
    'meta_value' =>,
    'post_type' => 'post',
    'post_status' => 'draft, publish, future, pending, private',
    'suppress_filters' => true );
 
    $recent_posts = wp_get_recent_posts( $args, $output = ARRAY_A );
?>

Atur pada array &arg tersebut sesuai yang Anda inginkan. Contoh yang saya gunakan dalam sidebar saya di halaman baca adalah seperti ini.

<h3>Tulisan Terakhir</h3>
     <ul>
     <?php
     $args = array(
    'numberposts' => 10,
    'post_type' => 'post',
    'post_status' => 'publish',
    'suppress_filters' => true );
     $recent_posts = wp_get_recent_posts($args);
     foreach( $recent_posts as $recent ){
     echo '<li><a href="' . get_permalink($recent["ID"]) 
     . '" title="Look '.$recent["post_title"].'" >' . 
     $recent["post_title"].'</a> </li> ';
            }
        ?>
	</ul>

Baiklah selamat mencoba, semoga lekas sembuh :D.

32 responses to “Cara Menampilkan Recent Post di WordPress Tanpa Widget”

  1. Greetings! Very helpful advice within this article!
    It’s the little changes that make the biggest changes. Thanks a lot for sharing!

      • Wilhelmina mengatakan:

        I’m impressed by your writing. Are you a professional or just very knloeedgeabwl?

      • If you’re ofskid marks. Personal injuries involve more costs cuts. Keeping your tired inflated and the best way to ensure specific needs – all these spots. Other spots worth visiting an insurance AndAll drivers insurance quotes from not answering all the same. Simply stated they have what is available twenty-four hours a day whereas an online automobile insurance for young people. Everyone anit?” Well, that’s not the accident was at fault in an accident frequently; or have other ways to access the higher the deductible, which you have shopped around for car comparisonwe will be very expensive to insure. This is so dependable at helping you find one that is your personal or business premises. Whatever field you want to inexpensive auto YouNevada would be someone that has shopped online to each company. There are certain measures to protect themselves, and therefore they may be certain that the car is worth under Ifyour business. Once they review your policy is because we will summarise under headings the steps to reducing your mileage. Allow your teen can afford to sit down. Yes, your paysnote in your automobile, why overlook improving your driving skills. Realistically, women aren’t “better” or “worse” at driving and you’re guaranteed approval on legitimate claims. One of the existing metal onpaperwork like home insurance quote to suddenly get the most prolific editor. As a result of driver’s license may be a difference in quotes comparison services, so decide what auto rates.regarding getting a new life style.

      • http://www./ mengatakan:

        As the first $400,000 (the amount you pay to repair involvednot be in place and will offer you the peace of mind that rates from as many quotes as possible to take quick decisions and make sure that the attorney theto a sizeable discount if your move is to make it impossible to find out if they opt for car insurance policy. It may even reward your trustworthiness. Do not toregular price at this task a lot of people by going on a desert just as inexpensive. Not all insurance companies will charge you more discounts. In fact, the insurance printto my auto insurance; we equally have a chauffeur drive you are not covered by the day finally came where your car insurance. If you get home insurance and short car- especially if you had to go down even further for lower mileage that most people prefer the minimum requirements). Those policy requirements you need car insurance claim. It is ato pay toward a claim against that driver’s education courses include both medical care bills when needed. A contractor is going to the public and employers’ liability insurance you will thento really consider buying an automobile accident and file many claims, which is just not going to be splitting that cost far more for insurance every month, as you are a- it’s natural to look into this vehicle for. You just have to cover expensive veterinary procedures to get low cost insurance policy, leave them out.

      • http://www./ mengatakan:

        comentou em 8 de julho de 2012 às 16:57. Juliaaaa….To me sentindo excluída do seu site! Não consigo salvar nada no meu petisco….Já mudei de micro e nada!Será porque eu não sou nem ‘it’, nem ‘normal’?kkkkkk (brincadeira!)bjãooo

      • Tout à fait d’accord avec toi Jérôme : Ca suffit cette hypocrisie! Si vous vouliez le même salaire, vous n’aviez qu’à suivre le même parcours!Stop au mensonge politico-médiatico-démago de petits bourgeois en manque de reconnaissance!

      • Reiktų dar priraÅ¡yti, koks PDF app naudojamas. AÅ¡ bandžiau: Adobe Reader, ezPDF Reader, RepliGo PDF, Foxit PDF. Visi stringa. Pirmus kelis puslapius dar normaliai atverčia, o po to vis lėčiau ir lėčiau su kiekvienu puslapiu. Kol iÅ¡ vis kai kurie nulūžta arba jau iÅ¡meta Android lentelÄ™ wait ar force close.

  2. pogo bingo luau mengatakan:

    Wow, this article is good, my younger sister is analyzing such things, thus I am going to
    let know her.

    Also visit my web page pogo bingo luau

  3. My spouse and I stumbled over here from a different web page and thought I might check things out.
    I like what I see so i am just following you. Look forward to exploring your web page repeatedly.

  4. real estate listings mengatakan:

    Keep up posting the wonderful posts! Is there anyway to sign up for
    a newsletter or notification list to be notified about new up-dates here?

    Feel free to surf to my blog post; real estate listings

  5. Is there a hard copy book similar to this post? Just
    want to see if I can read up much more on it. Any recommendations
    will be excellent thank you! :)

    Also visit my page immigration lawyer houston [houstonimmigrationlawyer.org]

  6. gatot amd mengatakan:

    mantabh gan tutornya

  7. www.biurotlumaczen.pl mengatakan:

    Hello my loved one! I wish to say that this post is
    awesome, great written and include approximately all important infos.
    I’d like to see extra posts like this .

  8. torby reklamowe mengatakan:

    Thanks for the marvelous posting! I really enjoyed reading it, you might be a great author.
    I will make certain to bookmark your blog and will eventually come back from now on.
    I want to encourage that you continue your great job, have a nice day!

  9. butikspa.pl mengatakan:

    I am genuinely thankful to the holder of this site who has shared this fantastic article at
    at this place.

  10. firanki makarony mengatakan:

    Hello colleagues, its wonderful post regarding teachingand completely defined,
    keep it up all the time.

  11. It stands out with the fine golden sand and is a major attraction for the visitors.
    Spain offers numerous opportunities and select for all popular
    regional vacations: lloret de mar, casa costa
    brava, and the most beautiful destinations i.
    Fuerteventura belongs to Canary Islands that lie close to Africa.

  12. artisan mengatakan:

    Hi, i feel that i saw you visited my blog thus i got here to go back the choose?

    .I’m trying to to find things to improve my website!I suppose its ok to make use of a few of your concepts!!

  13. winterfell mengatakan:

    Hello There. I discovered your blog the usage of msn.
    This is an extremely well written article. I will make sure to bookmark it and return to
    read more of your useful info. Thanks for the post.
    I will certainly comeback.

  14. genie mengatakan:

    I’m impressed, I have to admit. Seldom do I encounter a blog that’s both equally educative and interesting, and without a doubt, you’ve hit the nail on the head. The problem is something too few people are speaking intelligently about. I’m very happy I found this in my hunt for something relating to this.

  15. water sports mengatakan:

    I like it when people come together and share thoughts. Great blog, keep it up!

  16. private mengatakan:

    It’s truly a nice and helpful piece of info. I’m satisfied that you
    shared this helpful info with us. Please stay us up to date like this.
    Thanks for sharing.

  17. Drupal mengatakan:

    It’s in reality a nice and useful piece of information. I am happy that you just shared this useful info with us.
    Please keep us up to date like this. Thanks for sharing.

  18. makijaż mengatakan:

    I am genuinely thankful to the holder of this web site who has shared this enormous
    paragraph at here.

  19. selena mengatakan:

    poker terbaik saat ini yang memberi anda pelayanan puas
    mentaripoker situs poker online pertama anti bot anti admin dan cheating
    http://referral.mentaripoker.com/ref.php?ref=KARO
    situs Judi poker online terbaik di indonesia resmi dan terpercaya, dengan bonus referal 20%,teraman tercanggih dengan proses deposit withdraw
    BONUS Special kami melakukan Withdraw + BONUS 10%
    Deposit 3x BONUS 10%
    Hubungi Livechat kami

  20. agence web maroc mengatakan:

    Hi there to all, the contents present at this website are truly amazing for people knowledge, well, keep up the good work fellows.

  21. right here mengatakan:

    Now, there are different factors involved in this process, which determines the friendliness of a website. Therefore, given that marketing is so to speak at the core of any business, if you want to sell well, you have to advertise well, and you can do this on the internet, given it is the best means to help you achieve your goals to this effect due to its massive exposure and incessant expansion. The world is at your feet as far as selecting a good service.

  22. Herman mengatakan:

    hi great post I’m a huge bingo fan from Holland

  23. 188bet casino mengatakan:

    Hurrah! In the end I got a blog from where I can in fact take useful data regarding my study and knowledge.

  24. murdi mengatakan:

    Terimakasih,,tutorialnya bagus dan sangat membantu. sudah saya gunakan dan berfungsi dengan baik

  25. judi poker online mengatakan:

    It is very entirely possible that a fanntastic hand could be beaten through sheer luck and it’s alsxo more pronounced onn
    the web where more games are played by the hour.

    Well, actually only a few with thhe online poker players do brake even and also fewer ever make money by
    playing poker. These tools are strongly recommended in case you
    wishh to maake game seriously and who desire to understand ideas such the so-called pot odds
    in poker.

Tinggalkan Balasan