Type Name: Action

appthemes_after_pings

This function executes in the comments-[post_type].php file and loads after the custom post type trackback/pingback section.

appthemes_after_pings();

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

Changelog

  • since 1.1

Source File

appthemes_after_pings() is located in comments-[post_type].php.

appthemes_list_pings

This function executes in the comments-[post_type].php file and loads the pingback/trackback function call. You can remove this action and replace it with your own.

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_pings', 'your_function' );

Example

<?php
// remove the default ClassiPress pingback/trackback code
remove_action( 'appthemes_list_pings', 'cp_list_pings' );
 
// now load your own pingback/trackback code
function insert_your_code_block() { 
    global $post;
 
    wp_list_comments( array( 
        'callback' => 'my_custom_comment_callback', 
        'type' => 'pings'
     ) );
}
add_action( 'appthemes_list_pings', 'insert_your_code_block' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_list_pings() is located in comments-[post_type].php.

appthemes_before_pings

This function executes in the comments-[post_type].php file and loads before the custom post type trackback and pingback section.

appthemes_before_pings();

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

Changelog

  • since 1.1

Source File

appthemes_before_pings() is located in comments-[post_type].php.

appthemes_after_comments

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

appthemes_after_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_comments', 'insert_comments_disclaimer' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_after_comments() is located in comments-[post_type].php.

appthemes_comment

This function executes in the comments-[post_type].php file and loads in the custom post type comments.

appthemes_comment();

Example

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

Changelog

  • deprecated since 1.1

Source File

appthemes_comment() is located in comments-[post_type].php.

appthemes_list_comments

This function executes in the comments-[post_type].php file and loads in the custom post type comments. This is where the 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_comments', 'your_function' );

Example

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

Changelog

  • since 1.1

Source File

appthemes_list_comments() is located in comments-[post_type].php.

appthemes_before_comments

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

appthemes_before_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_before_comments', 'insert_comments_disclaimer' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_before_comments() is located in comments-[post_type].php.

appthemes_after_loop

This function executes in the loop-[post_type].php file and runs after the custom post type page loop is completed.

appthemes_after_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 <a href="mailto:info@example.com">info@example.com</a>.' ) . '</div>';
}
add_action( 'appthemes_after_loop', 'insert_feedback' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_after_loop() is located in loop-[post_type].php.

appthemes_loop_else

This action hook executes in the loop-[post_type].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_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_loop_else', 'insert_home_page_link' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_loop_else() is located in loop-[post_type].php.

appthemes_after_endwhile

This action hook executes in the loop-[post_type].php file and loads within the loop between endwhile; and else : runs.

appthemes_after_endwhile();

Example: Share Link

You can use this hook to add meta data to a post, 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_endwhile', 'insert_share_link' ); 
?>

Changelog

  • since 1.1

Source File

appthemes_after_endwhile() is located in loop-[post_type].php.