WordPress General Functions

Beginner
7 min read
Updated: Nov 2026
29 function guides
Function index

About This Index

This page is the WordPress General Functions index. Each row links to a full guide with syntax, three examples, and FAQs.

Learn what general template tags are and how themes use them on WordPress General Functions. Use this page when you need one function, such as bloginfo(), get_header(), or wp_enqueue_script().

Remember.

bloginfo() prints a value and get_bloginfo() returns it. Load theme files with get_header(), get_footer(), and get_template_part(), and add scripts with wp_enqueue_script() on the wp_enqueue_scripts hook.

How to Call a General Function

Most of these functions go in theme files. Some print right away, and some return a value that you echo.

WordPress
<?php get_header(); ?>
<h1><?php bloginfo( 'name' ); ?></h1>
<?php get_template_part( 'content', 'single' ); ?>
<a href="<?php echo esc_url( wp_login_url() ); ?>">Log in</a>
<?php get_footer(); ?>

WordPress General Functions Table

All function guides in this WordPress general series (29 tutorials). Start with bloginfo() and get_header().

Site info

4 functions

Read the site name, tagline, URL, version, and page title.

FunctionDescriptionTutorial
bloginfo()Print site information such as the name, tagline, URL, and charset.Read guide
get_bloginfo()Return site information such as the name, tagline, URL, and version as a string.Read guide
wp_title()Print or return the page title for the head of the page (older theme method).Read guide
get_current_blog_id()Get the ID of the current site (always 1 on a single site install).Read guide

Template loading

5 functions

Load the header, footer, sidebar, reusable parts, and the search form.

FunctionDescriptionTutorial
get_header()Load header.php or a named header file such as header-home.php.Read guide
get_footer()Load footer.php or a named footer file such as footer-shop.php.Read guide
get_sidebar()Load sidebar.php or a named sidebar file such as sidebar-shop.php.Read guide
get_template_part()Load a reusable template file such as content-single.php.Read guide
get_search_form()Print or return the site search form.Read guide

Archive titles

6 functions

Print the title of a post, category, tag, term, month, or post type archive.

FunctionDescriptionTutorial
single_post_title()Print or return the title of the current post or Page.Read guide
single_cat_title()Print or return the name of the current category on a category archive.Read guide
single_tag_title()Print or return the name of the current tag on a tag archive.Read guide
single_term_title()Print or return the name of the current term on a category, tag, or custom taxonomy archive.Read guide
single_month_title()Print or return the month and year of the current monthly archive.Read guide
post_type_archive_title()Print or return the title of a custom post type archive.Read guide

Archives, calendar & links

5 functions

List archives, build archive links, and show the post calendar.

FunctionDescriptionTutorial
wp_get_archives()Print or return a list of monthly, yearly, daily, or recent post archives.Read guide
get_archives_link()Build one archive link as a string in html, option, link, or custom format.Read guide
get_calendar()Print or return a small calendar table that links to days with posts.Read guide
delete_get_calendar_cache()Clear the cached calendar so get_calendar() builds a fresh one.Read guide
calendar_week_mod()Get the day of the week as a number from 0 to 6 (a modulo 7 helper).Read guide

Auth & meta helpers

9 functions

Login and logout links, the login form, the Meta list, allowed comment tags, and scripts.

FunctionDescriptionTutorial
wp_login_url()Get the address of the login page, with an optional redirect.Read guide
wp_logout_url()Get the address that logs the current user out, with an optional redirect.Read guide
wp_lostpassword_url()Get the address of the "Lost your password?" page.Read guide
wp_loginout()Print a Log in or Log out link, depending on the visitor.Read guide
wp_login_form()Print or return a ready-made login form for the front end.Read guide
wp_register()Print a Register link for guests or a Site Admin link for members.Read guide
wp_meta()Run the wp_meta action so plugins can add items to the Meta list.Read guide
allowed_tags()Get the HTML tags allowed in comments as a text string you can print.Read guide
wp_enqueue_script()Add a JavaScript file to the page the safe WordPress way.Read guide

Frequently Asked Questions

They are helper functions that themes use on almost every page: printing the site name, loading the header and footer, showing archive titles, and building login links.
bloginfo() prints the value right away. get_bloginfo() returns it so you can store it in a variable or join it with other text.
Use get_header(), get_footer(), get_sidebar(), or get_template_part(). Each one loads a file from your theme.
Use wp_enqueue_script() inside a function hooked to wp_enqueue_scripts. Do not write script tags by hand.
New themes should use add_theme_support( 'title-tag' ). Older themes use wp_title(), and archive pages can use the single_*_title() helpers.
Start with bloginfo(), get_header(), get_footer(), get_template_part(), and wp_enqueue_script(). Then learn the archive and login helpers.

Start with allowed_tags()

Get the HTML tags allowed in comments as a text string you can print.

allowed_tags() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

14 people found this page helpful