This function executes in the comments-page.php file and loads after the have_comments() if statement.
appthemes_after_page_comments(); |
Example: Legal Disclaimers
You can use this hook to add things like legal disclaimers or other information your readers should know after commenting.
<?php
function insert_comments_disclaimer() {
echo '<div class="disclaimer">' . __( 'Comments will be moderated and approved upon author\'s discretion.', 'appthemes' ) . '</div>';
}
add_action( 'appthemes_after_page_comments', 'insert_comments_disclaimer' );
?> |
Changelog
Source File
appthemes_after_page_comments()
is located in comments-page.php
.
This function executes in the comments-page.php file and loads in the page comments.
appthemes_page_comment(); |
Example
<?php
// now load your own comments code
function insert_your_code_block() {
// do something here
}
add_action( 'appthemes_page_comment', 'insert_your_code_block' );
?> |
Changelog
Source File
appthemes_page_comment()
is located in comments-page.php
.
This function executes in the comments-page.php file and loads in the page comments. This is where the page comments are hooked and loaded from.
Usage
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
add_action( 'appthemes_list_page_comments', 'your_function' ); |
Example
<?php
// remove the default ClassiPress page comments code
remove_action( 'appthemes_list_page_comments', 'cp_list_comments' );
// now load your own comments code
function insert_your_code_block() {
global $post;
wp_list_comments( array( 'callback' => 'my_custom_comments_callback', 'type' => 'comment' ) );
}
add_action( 'appthemes_list_page_comments', 'insert_your_code_block' );
?> |
Changelog
Source File
appthemes_list_page_comments()
is located in comments-page.php
.
This function executes in the comments-page.php file and runs before the comments template is loaded.
appthemes_before_page_comments(); |
Example: Share Link
You can use this hook to add meta data to a page, like a share link for social media sites.
<?php
function insert_share_link() {
echo '<div class="share-link">' . __( 'Share this link with your friends!', 'appthemes' ) . '<input type="text" value="' . esc_attr( get_permalink() ) . '">';
}
add_action( 'appthemes_before_page_comments', 'insert_share_link' );
?> |
Changelog
Source File
appthemes_before_page_comments()
is located in comments-page.php
.
This function executes in the page.php file and runs after the loop is completed.
Usage
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
add_action( 'appthemes_after_page_loop', 'your_function' ); |
Example: Feedback
You can use this hook to add things like feedback messages, legal disclaimers, or other information your readers should know after reading a page.
<?php
function insert_feedback() {
echo '<div class="feedback">' . __( 'Questions? Comments? Concerns? Email us at', 'appthemes') . '<a href="mailto:info@example.com">' . __('info@example.com', 'appthemes') .'</a></div>';
}
add_action( 'appthemes_after_page_loop', 'insert_feedback' );
?> |
Changelog
Source File
appthemes_after_page_loop()
is located in page.php
.
This action hook executes in the page.php file and loads within the loop between else;
and endif;
runs.
Use this action when you want to output something when a user didn’t find the page he/she was looking for.
Usage
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
add_action( 'appthemes_page_loop_else', 'your_function' ); |
Example: Redirect to Home Page
If your user didn’t find the page he was looking for, you can use this hook to give him a message or a link back to the home page.
<?php
function insert_home_page_link() {
echo '<a href="' . esc_attr( home_url() ) . '">' . __( 'Return to Home', 'appthemes' ) . '</a>.';
}
add_action( 'appthemes_page_loop_else', 'insert_home_page_link' );
?> |
Changelog
Source File
appthemes_page_loop_else()
is located in page.php
.
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. This action hook will only be called if a page is present, and will only be called once after outputting that page.
Usage
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
add_action( 'appthemes_after_page_endwhile', 'your_function' ); |
Example: Share Link
You can use this hook to add meta data to a page, like a share link for social media sites.
<?php
function insert_share_link() {
echo '<div class="share-link">' . __( 'Share this link with your friends!', 'appthemes' ) . '<input type="text" value="' . esc_attr( get_permalink() ) . '">';
}
add_action( 'appthemes_after_page_endwhile', 'insert_share_link' );
?> |
Changelog
Source File
appthemes_after_page_endwhile()
is located in page.php
.
This action hook executes in the page.php file and loads at the end of the_content() but before the loop endwhile
runs.
Use this hook when you want to output something at the bottom of a page, and want to use template tags like the_title() or the_permalink().
Usage
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
add_action( 'appthemes_after_page', 'your_function' ); |
Example: Share Link
You can use this hook to add meta data to a page, like a share link for social media sites.
<?php
function insert_share_link() {
echo '<div class="share-link">' . __( 'Share this link with your friends!', 'appthemes') . '<input type="text" value="' . esc_attr( get_permalink() ) . '">';
}
add_action( 'appthemes_after_page', 'insert_share_link' );
?> |
Changelog
Source File
appthemes_after_page()
is located in page.php
.
This action hook executes in the page.php file and loads right after the_content() is run.
Usage
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
add_action( 'appthemes_after_page_content', 'your_function' ); |
Example: Author Information
You can use this space to add information about the author or company.
<?php
function insert_company_bio() {
echo '<div class="bio">' . __( 'Example.com is a Southern California based company that specializes in serving up 404 pages.', 'appthemes' ) . '</div>';
}
add_action( 'appthemes_after_page_content', 'insert_company_bio' );
?> |
Example: Share Link
You can use this hook to add meta data to a page, like a share link for social media sites.
<?php
function insert_share_link() {
echo '<div class="share-link">' . __( 'Share this link with your friends!', 'appthemes' ) . '<input type="text" value="' . esc_attr( get_permalink() ) . '">';
}
add_action( 'appthemes_after_page_content', 'insert_share_link' );
?> |
Changelog
Source File
appthemes_after_page_content()
is located in page.php
.
This action hook executes in the page.php file and loads right before the_content() is run.
Usage
This hook provides no parameters. You use this hook by having your function echo output to the browser, or by having it perform background tasks. Your functions shouldn’t return, and shouldn’t take any parameters.
add_action( 'appthemes_before_page_content', 'your_function' ); |
Example: Advertisment
This code would display an AppThemes banner advertisement above the content of every page.
<?php
function insert_banner_ad_before_page() {
echo '<a href="http://www.appthemes.com"><img src="http://www.appthemes.com/ads/at-468x60a.gif"></a>';
}
add_action( 'appthemes_before_page_content', 'insert_banner_ad_before_page' );
?> |
Example: Adding an Announcement Bar
You can insert special information for the user about a sale, upcoming event, or other notification here.
<?php
function sale_annoucement() {
echo '<div class="annoucement">' . __( 'Come back July 5th for 10% off everything!', 'appthemes' ) . '</div>';
}
add_action( 'appthemes_before_page_content', 'sale_annoucement' );
?> |
Changelog
Source File
appthemes_before_page_content()
is located in page.php
.