General functions are the everyday helpers that a WordPress theme uses on almost every page. They print the site name, load the header, footer, and sidebar, show archive titles, list archives, and build login links.
Put them in theme files like header.php, single.php, and archive.php. Functions that add scripts or settings, such as wp_enqueue_script(), belong in functions.php inside a hook.
Syntax
Syntax
A typical theme template calls several general functions in order:
They are template tags and helpers that most themes use: printing the site name, loading the header, footer, and sidebar, showing archive titles, and building login links.
bloginfo() prints the value. get_bloginfo() returns it so you can store it or join it with other text.
Mostly in theme files such as header.php, footer.php, single.php, and archive.php. Some, like wp_enqueue_script(), go in functions.php on a hook.
Use get_template_part(). For example, get_template_part( 'content', 'single' ) loads content-single.php, or content.php if the first file is missing.
Call wp_enqueue_script() inside a function hooked to wp_enqueue_scripts. Do not add script tags by hand.
Open the WordPress General Functions index. It lists all 29 guides with short descriptions.