Does code in function.php differ from theme to theme

To start off, a theme does not require a functions.php file to operate. For example, a one page site can simply just have an index.php and a style.css file.

Your functions.php file holds functions, filters and action hooks to add theme specific functionality to your site. This extends core functions, add complete new functionality or even remove existing core functionality.

Each theme’s functions.php is unique to the theme, depending on the theme’s and end user’s needs for certain functionalities, although some functionalities might be found in other themes as well. These functionalities which are widely used in most themes includes things like adding theme support for thumbnails, adding navigation menus, adding widgets and sidebars and adding styles/scripts to the theme

It is also important to know that coding styles differ from person to person, so the same exact functionality can differ in code from one theme to the other depending on the author’s coding style. It come down to many ways to skin a cat.

I think the most important aspect to take into consideration when converting/creating/modifying a theme is what goes into your functions file and what does not. As I said, a theme functions.php is meant for theme specific functionalities, not for a site’s functionalities. My tip would be is to go and sit down, make a list of what functionalities to you need, and then decide whether the specific function is needed by the theme to make the theme functional, or is it needed to make the site functional. If a function is needed by the site, and not the theme, those functions should be added to a functionality plugin, and not the theme’s functions.php

Resources: