Getting fields of a content type in template file - creating a slideshow I need to add a slideshow (each slide containing headline, image &amp; html text) in my frontpage. I've decided to create a custom content type named slideshow which should have above fields.

I've figured out the necessary .tpl.php file (page--front.tpl.php) in which I'll add codes to go for the slideshow. 

What I've done already


Created a custom content type named slideshow with all the appropriate fields
Added all the necessary html for the slideshow in the .tpl.php template file - with necessary javascripts already included using the .info file of my theme.


Now the problem:


I think I'll fetch data from database &amp; populate the variables needed in .tpl.php file in: preprocess function of template.php file of the theme. How do I retrieve the fields of slideshow content type from database? 


Please help!
If I understand well your question, I guess that node.tpl.php is more suitable for use templates per content types an control over individual fields:

page.tpl.php: Default theme implementation to display a single Drupal page.

node.tpl.php: Default theme implementation to display a node.

About how to name your templates according your needs, see this documentation: Drupal 7 Template Suggestions http://drupal.org/node/1089656. Regarding your case, I guess, a template for content type, the name could be node--slideshow.tpl.php. see this answer that have information related with node.tpl.php.

and about how to see your fields, the same link to the answer have one example:

I have a field called field_demotext1, then this is the way that I can use to call their respective value inside any custom html zone of a node layout:

print $content['field_demotext1']['#items'][0]['value'];


whit print_r($content); (or dsm($content); if you use Devel module) you will see fields that can be pulled. this screenshot is using dsm($content); related with the example;



Render Drupal API is an alternative to the previous way. In this way you does not need seek the file using dsm() or print_r()

print render($content['field_demotext1']);


Also, seems that field_view_field is another alternative to render Drupal fields. see this related document:

I hope information be useful.