For a recent project I found it necessary to add some text on the “Add Listing” page. I thought i would share in case anyone else is interested.
The basic concept is to just add something to a hook before the form fields. In it’s simplest form it would go something like:
// Add help context text on the add-listing page
add_action( 'geodir_before_main_form_fields', 'my_add_listing_intro' );
function my_add_listing_intro() {
echo '<div class="my-add-listing-intro"><p>Some text</p></div>';
}
I took this a stage further by adding a different message depending on the CPT being used:
// Add help context text on the add-listing page
add_action( 'geodir_before_main_form_fields', 'my_add_listing_intro' );
function my_add_listing_intro() {
$listing_type = $_REQUEST['listing_type'];
if ( $listing_type == 'gd_church' ) {
$intro_text = 'the name of your Church';
}
elseif ( $listing_type == 'gd_school' ) {
$intro_text = 'the official name of your School';
}
elseif ( $listing_type == 'gd_shop' ) {
$intro_text = 'your business name';
}
echo '<div class="my-add-listing-intro"><p>The <em>Listing Title</em> field should be ' . $intro_text .'</p></div>';
}
Hopefully somebody might find this useful.