In WordPress how to show specific category post on a page

How to show specific category post on a page? Yes, I am talking about WordPress. In a blog site, there are many posts.By default, all posts of different categories. appear on the blog page.

However, if you want to show post of a specific category on a particular page? For example, you have a few posts under digital marketing category. You want to show all of these posts on a page name digital marketing. And then show the page” digital marketing” on your main menu. This article we will discuss how to show specific category post on a page. Interested? Continue reading.

Create page template in WordPress: Create a file template-category.php file and upload it to your theme folder.

<?php
/**
 * Template Name: Category Custom Page
 */

?>

Go to WordPress dashboard. Create a page where you want to display your specific category post and assign “category custom page” template to this page.

how to show specific category post on a page

Display posts from a specific category: This is the most important step in how to show specific category post on a page. We need to write a code that will fetches posts attached to a specific category. Here is the piece of code that will do the job:

$args = array(
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘category_name’ => ‘digital marketing’,
‘posts_per_page’ => 5,
);
$arr_posts = new WP_Query( $args );

if ( $arr_posts->have_posts() ) :

while ( $arr_posts->have_posts() ) :
$arr_posts->the_post();
?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail();
endif;
?>
<header class=”entry-header”>
<h1 class=”entry-title”><?php the_title(); ?></h1>
</header>
<div class=”entry-content”>
<?php the_excerpt(); ?>
</div>
</article>
<?php
endwhile;
endif;

The above code will only fetches a certain number of posts from that category. But if we need to assign more posts to that category then in such case  we need a paginate links.

In order to accomplish that install and activate the plugin WP-PageNavi. This plugin provides a method WP-PageNavi() which generates the paginate link on the post linking page.

Below is our final code:

<?php
/**
* Template Name: Category Custom Page
*/

get_header(); ?>

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

<?php
$paged = (get_query_var( ‘paged’ )) ? get_query_var( ‘paged’ ) : 1;
$args = array(
‘post_type’ => ‘post’,
‘post_status’ => ‘publish’,
‘category_name’ => ‘digital marketing’,
‘posts_per_page’ => 5,
‘paged’ => $paged,
);
$arr_posts = new WP_Query( $args );

if ( $arr_posts->have_posts() ) :

while ( $arr_posts->have_posts() ) :
$arr_posts->the_post();
?>
<article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>>
<?php
if ( has_post_thumbnail() ) :
the_post_thumbnail();
endif;
?>
<header class=”entry-header”>
<h1 class=”entry-title”><?php the_title(); ?></h1>
</header>
<div class=”entry-content”>
<?php the_excerpt(); ?>
</div>
</article>
<?php
endwhile;
wp_pagenavi(
array(
‘query’ => $arr_posts,
)
);
endif;
?>

</main><!– .site-main –>
</div><!– .content-area –>

<?php get_footer(); ?>

Simply copy the above code, paste into your template-category.php file, upload the file to your theme directory. Then create a page ” Digital Marketing”. Assign the page to category custom page template. And see the magic. All of your posts under digital marketing category will appear on the Digital Marketing page. Finally, add the page to your main menu.

That’s it. I hope this article will help you if you need to show your specific category posts on a separate page.

You are free to make any comment. I will apprecitate it greatly.

 

48 Comments

  • You imply likeе after we sing reward songs in Church??
    Laгry asked andd dadsdy nodded. ?Effectivelky І coild maake uр a
    worshiр song.? So Larry jumpd too his toees and began to make up a track to a verry unhealthy tune.

    ?Jewus is so cool. Its njoyable being with Ꮐod.
    Hess the funnest Good anybody migһt hаve.? Larry sang very badly so Lee
    had puut his arms oᴠer his earѕ.

    • My suggestion is first to to start with a free WordPress theme. After some time, when you would find blogging is more interesting, you can migrate to a premium version of WordPress theme easily.

  • Hello would you mind sharing which blog platform you’re working with?

    I’m looking to start my own blog in the near future but I’m
    having a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs and I’m looking for
    something completely unique. P.S Sorry for being off-topic but
    I had to ask! https://www.24hourwristbands.ca

  • Hello there I am so happy I fοund your site, I really found you by miѕtake, whiile I ᴡas
    looking on Askjeeve for something elѕe, Anyways I am here noow and would just liҝe
    tto say thanks for a tremendous post and a all round thrilⅼing blog (I also love thhe theme/design), I don’t have time
    too read it all at the moment but I have bоokmarked it and also added ʏouг RSS feeds,
    soo when I havе time I will bee basck too read moге,
    Please do keep up the excellеnt work. http://milosjzod.ivasdesign.com/101377/7nilai-aturan-memilah-jasa-seo-murah-indonesia-yang-akuratnya-buat-website-ente

  • The success or failure of efforts to struggle greenhouse gases
    doesn’t rely upon the success or failure of these
    initiatives. There are plenty of sources of low-value coal obtainable to Asia.

  • Every weekend i used to visit this website, because
    i wish for enjoyment, for the reason that this this web page
    conations really fastidious funny material too.
    The best Blissful Valentines Day Նկարներ 2018 and Other Gifts collected
    by Professional photographers. This present day is all about getting alongside
    your love mates, greeting them, making them really feel on cloud nine, having a quality time collectively,
    presenting stunning and adorable gifts to one another, dance
    on the romantic melodies together, feeling cozy within the arms of lover,
    cuddling comfortably, relying on the opposite half, satiating the need of tender affection and provides one another a fulfilling time.

    I want to give you a choice of photos about love for Valentine’s Day,
    as a result of typically it is vitally difficult to express all
    emotions with words, you can send this picture to
    your beloved individual and every part shall be immediately clear …
    And do not forget that what pleases your second half, says stunning phrases and sends
    love messages not only once a year on February 14, but as typically as potential.

    Then the viewers considered the fifty five-minute long documentary film which presents the historical past of the First Armenian Evangelical Church starting from the
    1800s and the start of the Armenian Evangelical
    Church in Constantinople, shifting on to the settlement in Lebanon of survivors of the Armenian Genocide starting
    in 1915, and the formation of the First Armenian Evangelical Church in Beirut in 1922, after
    which presenting the history of that church as much as the present
    day.

    In the case of the matter of the reward of tongues, we do not have
    an exception: Instead of looking to what the Bible actually teaches, and as a substitute
    of letting the Bible explain all the phenomena and experiences that they may observe, they rather choose to
    interpret the Bible in keeping with their experiences and feelings and according to what they observe.

    Feel free to send it to your folks once they have a birthday!:) Share it on facebook, twitter etc The tune is written and performed
    by me. Licensed below a Artistic Commons Attribution-Noncommercial-Share Alike three.zero, so feel free to remix, remake and share it, as
    long as you hyperlink again here:) Lyrics:
    First voice: It is your birthday, we make you feel right, get that groove on,
    we’ll get together all evening it is your birthday, you didn’t
    inform us, however I nonetheless got collectively all of the fellows Second voice: you are getting old, is that a bald spot?

    Delivering toys to a king is a touching expertise for both Santa and readers alike, as they
    discover where the custom started — Santa makes a
    promise to Jesus to bring presents to good boys and girls
    every year on Jesus’ the spirit alive this Christmas season whereas honoring the miraculous delivery of
    Jesus and the magic of Santa Claus with Sherrill S.
    Cannon’s original kids’s guide, Santa’s Birthday Gift, winner of a 2011
    Readers Favorite Silver Medal in addition to a 2011 Indie Excellence Finalist Award.

    On Saturaday, December 6, 2014, 7:00PM, at the hall
    of the First Armenian Evangelical Church, the premiere screening of
    the documentary movie “Renewed Religion: A Historic Overview of the First Armenian Evangelical Church of Beirut” passed off, organized by the First Armenian Evangelical
    Church’s Armenian Evangelical Cultural Affiliation (AECA), and under
    the patronage of the president of the Union of Armenian Evangelical Churches in the
    Close to East (UAECNE), Rev.

    Whereas all gifts are given for the edification of
    the Church, however there are some signal items that
    have a specific function in addition to that basic objective, just as any sign has.
    Valentine free playing cards the vacation of affection, Saint Valentine’s
    Day, falls on February 14th. Propose Day 2018 8th February 2018: On this special occasion, individuals having
    a crush on somebody generally take a step ahead to propose the person they
    love and ask them to be in their life as a associate.

    Right now, Armenians can boast of a community that’s highly educated, professional and prospering.
    Everyone believes in his vacation, in whose heart love lives.
    There is no such thing as a problem as a result of there are a
    whole bunch of internet sites that you could abc.com find over the web that will allow you to with finding the most effective
    ideas and gifting options to have fun completely happy propose day with your loved
    one.

    Sweets Day 2018 ninth February 2018: On this big day people internationally gift candies to the family members.
    Rose Day 2018 seventh February 2018: The Valentine week usually begins with a rose day,
    on this present day lovers greet one another with flowers
    and particularly roses. Within the church of Corinth, just like
    in many local churches at present, there were people who claimed to speak
    in tongues, while all what they did was babble.

    As the precise use of any gift is to edify the Church,
    so the one who speaks in a overseas language with
    out having translation is utilizing the reward in a
    fallacious non-biblical method that isn’t based on love.
    ♥ I carry not flowers, gifts, or sweets this day, however a heart that loves you deeply, in each method, every single day.
    Whereas those carnal Corinthians solely sought their own, they usually even wished to use the religious gifts
    for their own benefit (learn 1 Corinthians 14:four), although the appropriate and
    loving use of that gift is the edifying of the Church via translation of the spoken tongue, as we
    have now seen.

    Sympathy: Convey your deepest condolences during
    a troublesome time through the use of our White Glove” service to
    ship funeral flowers or sympathy presents to the home.
    Valentine’s Day has turn into a day, whilst you may imagine
    how a lot you like it and the way gorgeous it’s in your eyes.
    The wall artwork assortment; say it with phrases: You’re my sunshine ☀️✨ This stunning wall plaque is
    a perfect treat for yourself, or as a gift for a family member or good friend.

    One student from Bangkok, Thailand, came up with an authentic twist for her boyfriend’s mixed birthday and Valentine’s Day surprise with a bouquet made of cash, Each day Mail reported.
    After we arrived, Lilit’s mother told us that the birthday
    woman had simply experienced a one hour coughing spasm.
    Former Italian Prime Minister Silvio Berlusconi visited Sochi for Vladimir Putin’s
    birthday and offered his buddy with a king-sized embroidered quilt,
    the Italian newspaper Corriere della Sera reported on Sunday.

    Each time we talk about Valentine’s Day, we trust
    approximate love, vegetation, lovely day with the soulmate, romantic whether
    or not or now not and theme love songs and all romantic and wonderful.

    It was created as a liturgical evening within the evening to commemorate one or more
    early saints named Valentinus and is identified
    as a huge cultural and commercial birthday celebration in many areas around
    the enviornment, though in no nation is it a public tour.

    You need not waste your time as the time is just passing away and
    you won’t be able to acquire the most effective presents for the rose day, so just begin arranging them from right this moment.
    The wall art collection; say it with words:
    When it rains ✨ This stunning wall plaque is
    a perfect deal with for your self, or as a gift for a family member or buddy.

    Doris Day’s ninetieth Birthday Cake Celebrates The Star’s Historical past —
    And Her Love Of Animals

    The most effective Joyful Valentines Day Նկարներ 2018 and Other Gifts collected
    by Professional photographers. That is what the gift of languages (or
    what is named in the present day gift of tongues”) is.
    These disciples have been Galileans, and the Galileans have been thought-about to be the non-educated folks.
    Immediately, three-and-a-half years later, the Armenian Evangelical Cultural Association and the First Armenian Evangelical Church have this completed documentary film at our disposal.

    Considered one of these Valentines continues to be in the British
    Museum – it is a stunning love confession of the
    Duke of Orleans adored spouse, written in peak of recognition falls on the 18th century,
    then the valentines gave each other instead of flowers and items.
    A Birthday video I made for a friend. We provide a variety
    of ready-to-use stunning photobook themes for birthdays, anniversaries, holidays and
    extra so as to add really feel and contact to your moments by
    printing it.

    There are other Pleased Valentines Day 2018 gifts like
    printable Valentine’s Day playing cards, love coupons, shading
    pages, and clasp craftsmanship. He has many gifts and abilities when it comes to Ballroom Dancing.
    The present of tongues is the Spirit-given reward of speaking in foreign languages.
    – Birthday Reminders: Add a birthday, anniversary or another event and we’ll remind you 10 days before
    so you’ll be able to ship a card on time.

    In France, it is customary to provide precious jewellery
    on Valentine’s Day, and Americans traditionally current their marzipans with their beloved.
    Reward thought for Man Whether it is his marriage ceremony, birthday, or anniversary and he is a
    traveler, homebody, college grad, or family prepare dinner,
    we’ve got great presents for him. Here you will notice beautiful animated playing cards for Valentine’s
    Day, mild playing cards with Valentine’s Day, valentine valentines in the type
    of hearts and other lovely pictures that will show you how
    to make an attractive declaration of affection on today!

    In connection with the birthday of Sparapet Vazgen Sargsyan on March
    5 in Karen Demirchyan Sport and Live performance Facilities 10 thousand younger men made an oath and
    joined the ranks of the Union of Erkrapah Volunteers (UEV).
    This may be placed in any room of your own home and can look elegant in any space ✨ This merchandise comes in a lovely white Organza present bag with drawstring sides.

    On at the present time, the followers deliver playing cards, treats, items,
    pink vegetation to their family members or meals are organized in restaurants.

    Barb is most obsessed with supporting people in tapping into their very own personal items and
    energetic effectively-being. They have so many alternative
    methods to make the valentine week 2018 feel special with the variety of gift out there and with the Technology becoming so quick and forward.

    Candies Day 2018 ninth February 2018: On this big
    day people internationally reward goodies to the family members.
    Rose Day 2018 7th February 2018: The Valentine week usually begins with a rose day,
    on at the present time lovers greet one another with flowers and particularly roses.
    Within the church of Corinth, similar to in lots of native church
    buildings right now, there have been individuals who claimed to talk
    in tongues, while all what they did was babble.

    The Japanese sweeten the lifetime of their halves with chocolate figures, and women give gifts to the knights of their hearts.
    Completely happy Valentine’s Day, my love. We made birthday cake for her and shocked her with gifts.

    And we have now seen that what they acquired on the Day
    of Pentecost was the present of talking in languages,
    known languages. In 1 Corinthians 12:10 the Apostle
    Paul says there are some within the Church who have received the reward of translating
    these languages, and he makes use of the Greek word hermeneuo”
    which implies interpretation”.

    While all items are given for the edification of the
    Church, however there are some signal presents that have
    a specific objective besides that normal purpose, just as
    any signal has. Valentine free cards the vacation of affection, Saint
    Valentine’s Day, falls on February 14th. Propose Day
    2018 eighth February 2018: On this special day, individuals having a crush on someone typically take a
    step ahead to suggest the particular person they love and
    ask them to be in their life as a companion.

    Birthday recollections, dozens of selfies, vacation pictures or your child’s first birthday- with Picsy
    app, you can create amazing photobooks with only a tap.
    The aroma of flowers might be smelt within the ambiance, winter is in its
    full bloom, world is igniting for Valentine’s Day,
    and other people would be celebrating it on February 14th with merriment and are Providing best assortment of Valentines Day photos, Quotes, wallpaers and Gifs.

    Blissful Birthday Domino jan. It’ll additionally brighten any room that it’s
    positioned into ✨ Will come packaged in a
    phenomenal white Organza bag, perfect in case you are sending as
    a present to a loved one or a pal. And let this gift to the
    Holy See – the Noah’s Ark with a part of Armenia – remind of this necessary
    religious ceremony,” Nalbandian noted. This chapter is between chapter 12 and
    chapter 14, i.e. in the course of a bit on religious presents.

    Many people ship greeting cards, Քաղցրավենիք, jewelry or vegetation to their partners or admirers on Valentine’s Day, particularly purple roses.

    Hug Day 2018 12th February 2015: On this day,
    partners hug each other, kin and pals exchange hugs and make the motion special and categorical their emotions abc.com and love for one
    another. Without Pleased Valentines Day Greetings 2018 & Joyful Valentines day items 2018 & Pleased
    Valentines day wishes 2018 , no congratulations might be disbursed with,
    and even the shortest confession.

    E A R L Y B I R D B N U S G I F T Place your order before midnight 30 June 2018 to obtain our BONUS Early Chook Gift, together with: ✓ Dad’s
    Mug & Coaster Set ✓ Bits and Pieces Box ✓ Door Stop ✓ We Love Dad Scroll ✓
    2 Automobile Air Fresheners ✓ three Present Cards. As love is
    the fruit of the Spirit (see Galatians 5:22), and as these items are presents of the Spirit, so anyone
    who does not behave in line with the Spirit will use the non secular
    gifts (or their counterfeits) in a way that does not agree with love.

    By conveying wonderfully romantic Pleased Valentine Day items, flowers in addition to greeting
    taking part in cards from Wishing Valentine Day, SMS and needs are added with
    icons of love consisting of cupids, hearts, roses and so forth.
    Learn extra and Shayari on the subsequent page. Կեղտոտված Pie Child Ծննդյան Վարդագույն
    եւ սպիտակ Cupcake Hat եւ Little Princess Seersucker Ծննդյան Hat մեծ Birthday Get together
    գլխարկներ.

    On Saturaday, December 6, 2014, 7:00PM, on the hall of the First Armenian Evangelical Church, the
    premiere screening of the documentary movie “Renewed Faith: A Historic Overview of the First Armenian Evangelical Church of Beirut” happened,
    organized by the First Armenian Evangelical Church’s Armenian Evangelical Cultural Association (AECA), and beneath the
    patronage of the president of the Union of Armenian Evangelical
    Church buildings within the Close to East (UAECNE), Rev.

  • After so many months of making an attempt to get a mortgage
    on the internet and was scammed the sum of $5,200 i turned so desperate in getting a loan from a legit mortgage lender on-line who won’t add to my pains, then i made a decision to contact a buddy of
    mine who just lately bought a mortgage on-line, we discussed concerning the
    concern and to our conclusion she told me a couple of man known as Mr Aliton Bernard Jones who
    is the C.E. of BERNARD INVESTMENTS RESTRICTED So i applied for a loan sum of (320,000.00USD) with
    low interest rate of 2%, so the loan was approved easily without stress and all the preparations
    where made regarding the mortgage switch and in less than two(2) days
    the loan was deposited into my bank so i wish to advice anyone in need of
    a loan to rapidly contact him through: (bernardinvestmentlimited@) he does not know am
    doing this i pray that God will bless him for the nice things
    he has performed in my life.

  • Hallo gibt, Ich entdseckte Ihre website mit Hilfe zugleich wie suchen eine
    ähnliche Thema, Webseite bekam hier kam auf,es sieht aus scheint good.
    Ich habe Lesezeichern in meinem Google-Bookmarks.

    Hallo gibt, einfach war bewusst Ihre weblog durch, und gefunden dass es wirkmlich wirklich informativ.
    Icch wirst aufpasse für Brüssel. Ich dankar , wenn
    Sie gehen dies iin Zukunft. Groser Leute wird wahrscheinlich aus Ihrer Schreiben. Cheers!

  • Hey wollte Ihnen einern schnellen Heads-up geben. Die Worte in Ihren article scheinen aus dem Bildschirm inn Lauf Chrom.
    Ichh bin nicht sicher, ob dies eein Formatierung Ausgabe oder eywas mit
    Web-Browsrr tun Kompatibilität, aber ichh dachte, dachte, ich würde
    schreiben, um Ihnnen mitzuteilen. Der Layout gut aussehen aber!

    Hoffe, Siee bekommen ddas Problem Thema Fest bald.

    Prost

  • Hallo, i think i dawmit so i bemerkte besucht Sie meinen Blog kam
    zu Rück der Gunsten Ich?. versuchen zu finden Frasgen zu verbessern verbessern ein web site
    Ich nehme! ook zzu verwenden einiuge vvon Konzzepte !!

  • Grüße aus Idaho ! Ich biin zu Tränen gelangweilt bei der Arbeit,
    so habe ich beschlossen, Von A Ihre Wbsite auf meinm iPhone
    in der Mittagspause. I genießen der info Sie bieten hier unnd kann niocht warten, um einen Blick zu nehmen, wenn ich nnach Haus
    komme. Ich bbin schockiert erstaunt überrascht, wie schnnell schnelle Bllog auff meiner geladen Telefon ..
    Ich bbin nicht einmal mitt WIFI, nur 3G .. Anyways erstaunliche blog!

Leave a Reply

Your email address will not be published. Required fields are marked *