• Skip to primary navigation
  • Skip to main content

RocketGeek

Home of WP-Members, The Original WordPress Membership Plugin

  • WordPress Plugins
    • WP-Members
      • FAQs
      • Quick Start
      • Documentation
      • Extensions
    • Advanced Options
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Download Protect
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Invite Codes
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • MailChimp Integration
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • PayPal Subscriptions
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Salesforce Web-to-Lead
    • Security
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Text Editor
      • Purchase the Plugin
      • Get the Pro Bundle
    • User List
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • User Tracking
      • Documentation
      • Purchase the Plugin
      • Get the Pro Bundle
    • Memberships for WooCommerce
    • WordPass
  • Blog
    • Basics
    • Tips and Tricks
    • Filters
    • Actions
    • Code Snippets
    • Shortcodes
    • Design
    • Release Announcements
  • Store
    • Cart
    • Checkout
  • Contact
  • Log In
  • Show Search
Hide Search
Home » Basics » The functions.php file

The functions.php file

Chad Butler · Aug 17, 2012 · Leave a Comment

This article is provided free. Find out how you can get full access to premium content, including how-to articles and support forums, as well as priority email support and member exclusive plugin extensions..

 

The functions.php file is an important element in customizing WordPress.  It is also an important element in terms of customizing and integrating WP-Members into your site.

While you are not required to do any customization to get WP-Members to work on your site (it is, after all, a plugin), to leverage the power of the framework and thus make it look professional and seamless on your site, you will need to have some knowledge of the functions.php file.

The WordPress Codex defines the functions.php file like this:

A theme can optionally use a functions file, which resides in the theme subdirectory and is named functions.php. This file basically acts like a plugin, and if it is present in the theme you are using, it is automatically loaded during WordPress initialization (both for admin pages and external pages). Suggested uses for this file:

  • Enable Theme Features such as Sidebars, Navigation Menus, Post Thumbnails, Post Formats, Custom Headers, Custom Backgrounds and others.
  • Define functions used in several template files of your theme.
  • Set up an options menu, giving site owners options for colors, styles, and other aspects of your theme.

The default WordPress theme contains a functions.php file that defines many of these features, so you might want to use it as a model. Since functions.php basically functions as a plugin, the Function_Reference list is the best place to go for more information on what you can do with this file.

Adding Customizations to functions.php

Whether or not you are doing your customizations in a Child Theme is a topic for a separate discussion.  For now, just suffice to say that much of the example code given on this site in terms of hooking into WP and WP-Members will go into your functions.php file.

This file will begin with an opening php delimiter: <?php

It may or may not close with a closing delimiter: ?>

What if I don’t have a functions.php file in my theme?

Most themes have a functions.php file.  If yours does not, it’s ok to just create one.  It just needs to be named functions.php, be saved to your theme’s root folder, and open/close with <?php …all of your lines of code in between… ?>

You can refer to the functions.php file that is included with the WordPress default themes as a guide or a starting point.

Caveat emptor

Some themes have a custom functions file that gets loaded by the theme.  Sometimes this might be called something as obvious as custom-functions.php.  If you have a theme framework like Thesis or Genesis, it is quite possible that you’ll be putting your custom functions in a custom functions file rather than directly into functions.php.  Consult your theme documentation on this.

When in doubt, ask the theme developer.  They’ll know.

Conclusion

You don’t have to be a code junkie or developer to be able to leverage functions.php to your advantage.  And if you are testing things out on a testing server rather than working on your live site, this shouldn’t be complicated, frustrating, or scary.  (You do follow work flow best practices by testing everything in a testing environment, don’t you?)

Basics basics, customizing, functions.php, tips, wordpress

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Ready to get started?

Join Today!

© 2025 · butlerblog.com · RocketGeek is built using WordPress, WP-Members, and the Genesis Framework

  • butlerblog.com
  • WP-Members Support Subscription
  • Terms of Service
  • Privacy Policy
  • Refund Policy