Novice

Programatically create taxonomy terms

Writing code to create multiple taxonomy items without a parent is really easy. Function taxonomy_term_save($term) requires an object as parameter. An array containing the term name and the vocabulary where to insert is parsed as an object and added as argument. This example shows inserting data in its simplest form, only a name and a vocabulary id is needed.

Remove the read more and comment links on nodes

MYTHEME_preprocess_node is the best solution as it is a theme adjustement. However, when you're using a default Drupal theme, then instead of hacking core, use hook_node_view_alter(&build) inside a custom module.

Pages

Subscribe to RSS - Novice