appthemes_page_loop_else

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

  • since 1.1

Source File

appthemes_page_loop_else() is located in page.php.

Your rating: none
Rating: 0 - 0 votes

Popular Add-ons

Critic

A professional review and rating system for WordPress.


(13)
$29

Profiler for Vantage

Adds a one page author website to your Vantage theme.


(6)
$39

2Checkout

Accept up to eight payment methods, fifteen languages, & twenty six…


(4)
$39