Docs

Action Hooks

Init Hooks - (1)

These hooks are located in the includes/theme-functions.php and run at init.

appthemes_init
This hook runs after all theme files have been included, but before anything else is loaded into the theme.

Header Hooks - (3)

These hooks are located in the header.php theme template file.

appthemes_after_header
Runs in the header.php file and loads after the theme header code. Usage This hook provides no parameters.
appthemes_before_header
Runs in the header.php after the opening div tag and before the main header section is called at the top of the theme.
appthemes_header
Runs in the header.php and loads in the theme header code found in /includes/theme-header.php.

Page Hooks - (10)

These hooks are located in the page.php, comments-page.php, and any other theme template or loop related to pages.

appthemes_after_page
This action hook executes in the page.php file and loads at the end of the_content() but before the loop endwhile runs.
appthemes_after_page_comments_form
This function executes in the comments-page.php file and loads after the page comments respond form. Usage This hook provides no parameters.
appthemes_after_page_content
This action hook executes in the page.php file and loads right after the_content() is run. Usage This hook provides no parameters.
appthemes_after_page_endwhile
This action hook executes in the page.php file and loads within the loop between endwhile; and else : runs. Use this action hook to display something after a page.
appthemes_after_page_loop
This function executes in the page.php file and runs after the loop is completed. Usage This hook provides no parameters.
appthemes_after_page_pings
This function executes in the comments-page.php file and loads after the trackback/pingback section. Usage This hook provides no parameters.
appthemes_after_page_respond
This function executes in the comments-page.php file and loads after the comments respond form. Usage This hook provides no parameters.
appthemes_after_page_title
Runs in the loop.php and loads after the page title. Usage This hook provides no parameters.
appthemes_before_blog_comments_form
This function executes in the comments-blog.php file and loads before the blog comments respond form. Usage This hook provides no parameters.
appthemes_before_page
Executes in the page.php file and runs after have_posts() within the loop whenever any page is loaded. Usage This hook provides no parameters.

Blog Hooks - (10)

These hooks are located in the tpl-blog.php, single.php, comments-blog.php, loop.php, and any other theme template or loop related to the blog.

appthemes_after_blog_comments_form
This function executes in the comments.php file and loads after the blog comment...
appthemes_after_blog_endwhile
This action hook executes in the loop.php file and loads within the loop between endwhile; and else : runs. Use this action hook to display something after a post or series of posts.
appthemes_after_blog_loop
This function executes in the loop.php file and runs after the loop is completed...
appthemes_after_blog_pings
This function executes in the comments-blog.php file and loads after the trackba...
appthemes_after_blog_post
This action hook executes in the loop.php file and loads at the end of the_conte...
appthemes_after_blog_post_content
This action hook executes in the loop.php file and loads right after the_content...
appthemes_after_blog_post_title
Runs in the loop.php and loads after the blog post title. appthemes_after_b...
appthemes_after_blog_respond
This function executes in the comments-blog.php file and loads after the comment...
appthemes_before_blog_comments
This function executes in the comments-blog.php file and runs before the comment...
appthemes_before_blog_loop
Runs in the loop.php file and runs before the have_posts() loop whenever any blog post is loaded. appthemes_before_blog_loop(); Example: Advertisment This code would display an AppThemes banner advertisement above the content of every page. function insert_banner_ad_before_page_loop() { echo ''; } add_action( 'appthemes_before_blog_loop', 'insert_banner_ad_before_page_loop' ); Example: Advertisment on category page This code would display an AppThemes banner advertisement above the content of category page. function insert_banner_ad_on_category_page() { if(is_category()) echo ''; } add_action( 'appthemes_before_blog_loop', 'insert_banner_ad_on_category_page' ); Example: Adding an Announcement Bar You can insert special information for the user about a sale, upcoming event, or other notification here. function sale_annoucement() { echo '' .

Custom Post Type Hooks - (10)

These hooks are located in the single-[post_type].php, comments.php, loop-[post_type].php, and any other theme template or loop related to the custom post type or taxonomies.

appthemes_after_comments
This function executes in the comments-[post_type].php file and loads after the ...
appthemes_after_comments_form
This function executes in the comments-[post_type].php file and loads after the ...
appthemes_after_endwhile
This action hook executes in the loop-[post_type].php file and loads within the ...
appthemes_after_loop
This function executes in the loop-[post_type].php file and runs after the custo...
appthemes_after_pings
This function executes in the comments-[post_type].php file and loads after the ...
appthemes_after_post
This action hook executes in the loop-[post_type].php file and loads at the end ...
appthemes_after_post_content
This action hook executes in the loop-[post_type].php file and loads right after...
appthemes_after_post_title
Runs in the loop-[post_type].php and loads after the custom post type title (usually in an h1 or h2 tag) is displayed on the page.
appthemes_before_comments
This function executes in the comments-[post_type].php file and runs before the ...
appthemes_before_loop
Runs in the loop-[post_type].php file and runs before the have_posts() loop whenever any custom post type content (i.e.

Sidebar Hooks - (2)

These hooks are located in the sidebar.php file and any other theme sidebar templates related to the custom post type or taxonomies.

appthemes_after_sidebar_widgets
This function executes in the sidebar files (sidebar.php, sidebar-user.php, sidebar-blog.php, etc) and loads after the dynamic sidebar code. appthemes_after_sidebar_widgets(); Example: Twitter Widget You can add a Twitter Widget or link to your Twitter using this hook.
appthemes_before_sidebar_widgets
This function executes in the sidebar files (sidebar.php, sidebar-user.php, sidebar-blog.php, etc) and loads before the dynamic sidebar code. appthemes_before_sidebar_widgets(); Example: Twitter Widget You can add a Twitter Widget or link to your Twitter using this hook.

Footer Hooks - (3)

These hooks are located in the footer.php theme template file.

appthemes_after_footer
This function executes in the footer.php file and loads after the WordPress foot...
appthemes_before_footer
This function executes in the footer.php file and loads before the WordPress foo...
appthemes_footer
This function executes in the footer.php file after the WordPress footer hook wp_footer() and loads the entire theme footer code.

Admin Hooks - (2)

Below you will find a our admin hooks which are different than the others as they control things within the WordPress admin area vs the front-end of the theme. For example, you can create custom admin menus and options with these hooks.

These hooks trigger the creation of admin sub-menus and option pages. They hook into the existing theme add_menu_page and appear before the theme "System Info" admin menu item.

appthemes_add_submenu_page
The appthemes_add_submenu_page action hook is triggered within the WordPress admin theme option pages.
appthemes_add_submenu_page_content
This action hook is triggered within the WordPress admin theme option pages.
css.php