Type Name: Action

appthemes_after_blog_post

This action hook executes in the loop.php file and loads at the end of the_content() but before the loop endwhile runs.

appthemes_after_blog_post();

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_blog_post', '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_blog_post', 'insert_share_link' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_after_blog_post() is located in loop.php.

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. This action hook will only be called if a post or multiple posts are present, and will only be called once after all the posts have been outputted.

This hook is used by both multiple post archive pages, as well as single pages.

appthemes_after_blog_endwhile();

Example: RSS Feed Link

<?php
function insert_rss_link() { 
    echo '<div class="rss-link">' . __('Want more? Subscribe to our feed via RSS.') . '<a href="' . esc_attr( get_bloginfo( 'rss2_url' ) ) . '">' . __( 'Click Here') . '</a>';
}
add_action( 'appthemes_after_blog_endwhile', 'insert_rss_link' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_after_blog_endwhile() is located in loop.php.

appthemes_blog_loop_else

This action hook executes in the loop.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.

appthemes_blog_loop_else();

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

  • since 1.1

Source File

appthemes_blog_loop_else() is located in loop.php.

appthemes_after_blog_loop

This function executes in the loop.php file and runs after the loop is completed.

appthemes_after_blog_loop();

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_blog_loop', 'insert_feedback' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_after_blog_loop() is located in loop.php.

appthemes_before_blog_comments

This function executes in the comments-blog.php file and runs before the comments template is loaded.

appthemes_before_blog_comments();

Example: Legal Disclaimers

You can use this hook to add things like legal disclaimers or other information your readers should know before 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_before_blog_comments', 'insert_comments_disclaimer' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_before_blog_comments() is located in comments-blog.php.

appthemes_list_blog_comments

This function executes in the comments-blog.php file and loads in the page comments. This is where the blog 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_blog_comments', 'your_function' );

Example

<?php
// remove the default ClassiPress blog comments code
remove_action( 'appthemes_list_blog_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_blog_comments', 'insert_your_code_block' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_list_blog_comments() is located in comments-blog.php.

appthemes_blog_comment

This function executes in the comments-blog.php file and loads in the page comments.

appthemes_blog_comment();

Example

<?php
// now load your own comments code
function insert_your_code_block() { 
    // do something here
}
add_action( 'appthemes_blog_comment', 'insert_your_code_block' ); 
?>

Changelog

  • deprecated since 1.1

Source File

appthemes_blog_comment() is located in comments-blog.php.

appthemes_after_blog_comments

This function executes in the comments-blog.php file and loads after the have_comments() if statement.

appthemes_after_blog_comments();

Example

Example: Legal Disclaimers

You can use this hook to add things like legal disclaimers or other information your readers should know after commenting.

' . __( 'Comments will be moderated and approved upon author\'s discretion.' , 'appthemes' ) . '

';
}
add_action( 'appthemes_after_blog_comments', 'insert_comments_disclaimer' );

Changelog

  • since 1.1

Source File

appthemes_after_blog_comments() is located in comments-blog.php.