javascript - How can I limit categories displaying in posts

I want to show the limited categories displaying in my post. Here is my blog page.
Kindly visit the page and give me advice how can i reduce category number displaying. I have tried with this codes but not working
<?php
// display 7 random categories
$cats ='';
$categories=get_categories('posts_per_page=5&exclude=' . $GLOBALS[asides_id]);
$rand_keys = array_rand($categories, 4);
foreach ($rand_keys as $key) {
$cats .= $categories[$key]->term_id .',';
}
wp_list_categories('title_li=&include='.$cats);
?>
Answer
Solution:
Would you please try theget_categories
function in the following way?
$categories=get_categories( array(
'number' => 5,
'exclude' => $GLOBALS[asides_id]
) );
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: a non well formed numeric value encountered
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.