Get Fields of a custom Content Type from Database in Drupal 7 I'm trying to get custom fields of my custom content-type "slideshow". I've chosen to get the fields from template (.tpl.php) file for some reasons (mainly because I've to write lots of formatting HTMLs and modifying lots of template files did not sound good). 

So far, What I've got is individual nodes:

$result = db_query_range('SELECT n.nid
                      FROM {node} n WHERE n.type = :ntype', 0, 10, array(':ntype' =&gt; 'slideshow'));
foreach ($result as $record) {
    $node = node_load($record-&gt;nid);
    // Got $node! What to do now????
}


The code works &amp; I've got nodes in $node. Now What to do to get individual custom fields &amp; work with the raw data of these fields? Please help.

PS I've tried Get content type with PHP from database but the code does not work... guess it's for older Drupal versions.
You could always try field_get_items if you know the names of the fields you want. field_get_items('node', $node, 'field_name');

Although node_load() should be providing the fields for you and can be found at $node-&gt;field_name

Also Attiks advice is sound, I would also not recommend doing this in tpl