HTML tutorial

Welcome to Our Community

Still Not Registered? Wanting to join the rest of our members? Feel free to sign up today.

Sign Up
  1. Gat a job for us? Contact us on ICQ with 745689828. You can download ICQ from play store.
    Dismiss Notice
  2. When You Click on an external link, an ad is first shown...Pls allow for 4 second then click on "skip ad" to access your original link.
    Dismiss Notice

How To Display Post From A Specific Category In Wordpress

Discussion in 'Programming' started by ROBOT, Mar 29, 2018.

  1. ROBOT

    ROBOTROBOT is a Verified Member Administrator
    VIP user

    Joined:
    Mar 18, 2018
    Messages:
    168
    Likes Received:
    620
    Credit:
    ₦14.00
    This tutorial is a straight forward one, sometimes we may need to display post on our home page from a specific category, sometimes it may be you want to display from music, videos, news all on the index with different title.

    This code will
    call up the recent entries for a
    specific post. Just change Category Name to
    the name oft he category. Then enter how many posts you would like shown.

    Just put the codes yourself below in anywhere you want it to appear(e.g index.php)
    PHP:
    <?php query_posts('category_name=CATEGORYNAME&showposts=5');
    while (
    have_posts()) : the_post();
    // do whatever you want
    ?>
    <b><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
    <?php
    endwhile;
    ?>
    Share with pals and link back to cyberleets
     
  2. Kevin chux

    Kevin chux New Member

    Joined:
    Aug 30, 2018
    Messages:
    73
    Likes Received:
    79
    Credit:
    ₦10.00
    Wow, very nice indeed...
     
    Semiloore likes this.
  3. Goldenson

    GoldensonGoldenson is a Verified Member Community Elder

    Joined:
    Aug 20, 2018
    Messages:
    228
    Likes Received:
    669
    Credit:
    ₦4.00
    Thanks for this, really helpful.
     
    Semiloore likes this.
  4. WISEONE

    WISEONE New Member

    Joined:
    Nov 12, 2018
    Messages:
    4
    Likes Received:
    0
    Credit:
    ₦423.00
    awesome
     
  5. cyberlord

    cyberlordcyberlord is a Verified Member Administrator
    Staff Member VIP user

    Joined:
    Mar 13, 2018
    Messages:
    517
    Likes Received:
    1,581
    Credit:
    ₦16,669.75
    Thanks for dropping by
     
  6. Kingsley

    Kingsley Community Elder

    Joined:
    Nov 16, 2018
    Messages:
    156
    Likes Received:
    23
    Credit:
    ₦1,056.24
    Cool
     
  7. Anda

    Anda New Member

    Joined:
    Dec 8, 2018
    Messages:
    6
    Likes Received:
    0
    Credit:
    ₦557.32
    This is really helpful thanks alot
     
  8. Tribe

    Tribe New Member

    Joined:
    Nov 12, 2018
    Messages:
    26
    Likes Received:
    4
    Credit:
    ₦149.76
    Thants bro useful
     

Share This Page