If you want to create a custom functionality in your Joomla site related to the articles and you have to get the article details by using article ID, then keep your close attention in this post as I am going share how to get the article by article ID in Joomla 3.
Copy the below code snippet and use it in any Joomla template file.
* Get article by article ID
$db = &JFactory::getDBO();
$sql = "SELECT introtext FROM #__content WHERE id = ".intval($articleId);
$fullArticle = $db->loadResult();
$fullArticle = "Article is empty";
Liked this program? Do Like & share with your friends.
Prem Tiwari is the founder of FreeWebMentor.com and also a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby and also he has been a regular speaker of WordPress sessions in various IT Companies. View all posts by Prem Tiwari