TheeDigital > Blog > The Most Common WordPress Functions

The Most Common WordPress Functions

WordPress is a great content management system (CMS) platform for websites. It is user friendly and highly customizable, making it a TheeDigital favorite for client projects. This post will go over some of common PHP codes used in custom WordPress theme development. You'll need access to a WordPress site in order to follow along.

Categories:  WordPress
3 min read
WordPress is the prevailing content management system (CMS) platform for various types of websites. It’s user-friendly and highly customizable, making it a popular choice at TheeDigital for client projects. This post lists common PHP codes used in custom WordPress theme development. We provide a basic overview of how to incorporate these functions into your WordPress site, and you’ll need access to a WordPress site to follow along.
The Most Common WordPress Functions
Title of the site <?php bloginfo(‘title of my site’); ?>
Title of specific post or page <?php wp_title(); ?>
The style.css file’s theme location <?php bloginfo(‘stylesheet_ url’); ?>
Pingback URL for the site <?php bloginfo(‘pingback_url’); ?>
Location for the site’s theme file <?php bloginfo(‘template_url’); ?>
WordPress version for the site <?php bloginfo(‘version’); ?>
Atom URL for the site <?php bloginfo(‘atom_url’); ?>
Exact URL for the site <?php bloginfo(‘rss2_url’); ?>
Name of the site <?php bloginfo(‘name’); ?>
Html version of the site <?php bloginfo(‘html_type’); ?>
Charset parameter of the site <?php bloginfo(‘charset’); ?>
Author of a specific post or page <?php the_author(); ?>
ID of a specific post or page <?php the_ID(); ?>
Link to edit a specific post or page <?php edit_ post_link(); ?>
Links from the blogroll <?php get_links_ list(); ?>
Comment.php file’s content <?php comments_template(); ?>
List of pages of the site <?php wp_ list_pages(); ?>
List of categories for the site <?php wp_ list_cats(); ?>
URL to the next post <?php next_ post_link(‘%link’) ?>
URL to the previous post <?php previous_post_link(‘%link’) ?>
The built-in calendar <?php get_calendar(); ?>
List of archives for the site <?php wp_get_archives() ?>
Next and previous post link <?php posts_nav_link(); ?>
Site’s description <?php bloginfo(‘description’); ?>
Content of the posts <?php the_content();?>
Checks if there are posts <?php if(have_posts()) : ?>
Shows posts if posts are available <?php while(have_posts()) : the_post(); ?>
Closes the ‘while’ PHP function <?php endwhile; ?>
Closes the ‘if’ PHP function <?php endif; ?>
Header.php file’s content <?php get_header(); ?>
Sidebar.php file’s content <?php get_sidebar(); ?>
Footer.php file’s content <?php get_footer(); ?>
The date in ’06-21-11′ format <?php the_time(‘m-d-y’) ?>
Link for the comments on the post <?php comments_popup_link(); ?>
Title of a specific post or page <?php the_title ();?>
URL of a specific post or page <?php the_permalink() ?>
Category of a specific post or page <?php the_category(‘,’) ?>

How to Use WordPress Functions

One strength of WordPress that has contributed to its widespread use is its intuitive user interface for content producers mixed with enough configuration options for any serious developer to tailor the CMS to meet unique needs. The WordPress functions listed above are provided by WordPress and can be used when developing a WordPress theme, but WordPress is extensible and allows for custom functions to be written. Fortunately, in many cases, the functions that WordPress provides are more than enough to build or change a business or organization website. If you’re creating your own custom WordPress theme, or you want to know how to edit one that you already have installed, then perform these steps:
  1. Log into your WordPress site. A common place to do that is at: However, the exact location of the WordPress login page will depend on how your site was set up.
  2. Once logged into WordPress, you will see a page called the Dashboard. On the left side should be a navigation menu, and you’ll want to find the AppearanceEditor section to view the relevant WordPress files.
  3. The Editor page will have a list of files you can view and edit on the right side. To get started, you can choose index.php from that list by clicking on it.
The first line of the index.php template might look have this piece of code: <?php get_header(); ?>. That’s simply snippet of code that says “Place the header content at the top of this page.” In another file, one that is commonly named header.php, there’s code that specifies what the header actually contains. If you’re still in the Editor section of WordPress, you can select header.php from the list on the right to see how that is built. That should be enough to whet your appetite! Below you will find more useful code snippets commonly used in WordPress.
Additional Useful WordPress Code Snippets
Custom permalinks /%postname%/
Include any file <?php include(TEMPLATEPATH .’/x’); ?>
Value for search form <?php the_search_ query(); ?>
Prints out message <?php _e(‘Message’); ?>
Displays the register link <?php wp_register(); ?>
Displays the login/logout link <?php wp_loginout(); ?>
Divides the content into pages <!–next page–>
Cuts off the content <!–more–>
Meta for administators <?php wp_meta(); ?>
Time to load the page <?php timer_stop(1); ?>
Queries to load the page <?php echo get_num_queries(); ?>
If you aren’t familiar with WordPress, give it a try by installing it on your own computer. Or if you need assistance making your website vision a working reality – contact one of our WordPress designers at TheeDesign in Raleigh, NC at 919-341-8901 or schedule a consultation to get the project started for you.

About The Author:
Richard Horvath

Richard Horvath is the founder of TheeDigital, a Raleigh based award-winning web design and digital marketing agency. He is proud of his team and the results that they provide to their clients.

Related Posts

How to Update Your WordPress Plugins Safely

How to Update Your WordPress Plugins Safely

While the idea of updating your plugins may make your cringe slightly, we’re here to tell that most WordPress plugin updates shouldn’t…

Kristina Cappetta

4 min read
How to create a new gravity form

Gravity Forms – How to Create a New Form

Here you'll learn how to create and edit a Gravity Form on your site.

Richard Horvath

5 min read
Top WordPress Web Development Trends for 2023

Top WordPress Web Development Trends for 2023

What's going to be big on Wordpress next year? Read on to discover what's new.

Melissa Read

4 min read
What are Wireframe Mockups?

Wireframes for Custom-Designed WordPress Sites

Utilizing Wireframing to ensure a stand out website design is vital. But Wireframes can be confusing. Learn how they help the design…

Melissa Read

2 min read
Call 919-341-8901 M NU