Action Hooks

Action hooks are useful for adding extras so here are list of action hooks that you can use with Auto Load Next Post. All hooks are related to the template file.

The Loop

Use this to display content before the loop.

add_action( 'alnp_load_before_loop', 'your_function_name' );

Use this to display content after the loop.

add_action( 'alnp_load_after_loop', 'your_function_name' );

The Content

Use this to display content before the content.

add_action( 'alnp_load_before_content', 'your_function_name' );

Similar to the one above only this one is specific to the post format of the loaded post.

add_action( 'alnp_load_before_content_post_format_' . $post_format, 'your_function_name' );

Use this to display content after the content.

add_action( 'alnp_load_after_content', 'your_function_name' );

Similar to the one above only this one is specific to the post format of the loaded post.

add_action( 'alnp_load_after_content_post_format_' . $post_format, 'your_function_name' );

Replace $post_format with one of the supported formats. See Post Formats for a list of supported formats that you can use to display content for a specific post format.

An example of adding content to a specific post format with one of the action hooks.

function your_function_name(){
echo 'This video is awesome. Share it with your friends!';
}
add_action( 'alnp_load_after_content_type_video', 'your_function_name' );

So whenever a post that is formatted for video, after the content it will display whatever you want it to display.

Please know: Not all themes support post formatting but if you are creating a WordPress theme yourself then this would be a great feature to support.

No More Posts

Once there are no more posts to load you can use this action hook.

add_action( 'alnp_no_more_posts', 'your_function_name' );

You can use the action hooks demonstration plugin to show you an example of the action hooks in action. Each hook will load depending on your content. Action hooks that load before content are shown in white. Action hooks that load after content are shown in black.