Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. //custom recent news menu with specific news category
  2.  
  3. //find this following code below in the api.php file
  4. $query = "SELECT * FROM tbl_news_category c,tbl_news n WHERE c.cid=n.cat_id ORDER BY n.nid DESC, n.news_status ASC LIMIT $limit";
  5.  
  6. //change the sql select query function to display specific category
  7. $query = "SELECT * FROM tbl_news_category c,tbl_news n WHERE c.cid=n.cat_id AND c.category_name = '<CATEGORY NAME>' ORDER BY n.nid DESC, n.news_status ASC LIMIT $limit";
  8.  
  9. //note
  10. //'<CATEGORY NAME>' means your category name, as example, if your category name is 'Entertainment', replace '<CATEGORY NAME>' with 'Entertainment'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement