Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By deepak_mishra on
How to create a category Landing Page 4 blocks to be called without using views Module i.e fields are Image, Description and Read more
Comments
I hope code below helps you
I hope code below helps you with your issue.
function get_terms(){
$vocabulary = taxonomy_vocabulary_machine_name_load(YOUR_TAXONOMY_MACHINE_NAME); // put it in quotes
// passing vid of taxonomy through 'taxonomy_get_tree' function to get all terms belong to it
$terms = taxonomy_get_tree($vocabulary->vid);
$term = array();
foreach($terms as $value){ // iterate through each term
$term = taxonomy_term_load($value->tid); // pass tid to get term object
$title = $term->name;
$description = $term->description;
}
}
Thank You,
Shashwat Purav
Thank you for your help
Thank you for your help