Adds the ability to easily enter and display contact information.
Adds the ability to enter contact information and output the details in your posts, pages or templates.
Use the shortcode [contact type="phone"]
to display any of the contact details, or use the function call <?php if ( function_exists( 'contact_detail' ) ) { contact_detail( 'phone' ); } ?>
.
Once you have defined a contact email address, use the shortcode [contact type="form"]
to output the contact form.
Languages: Also available in Español (Spanish) and українська (Ukrainian by Michael Yunat).
Here we go:
contact
folder to the /wp-content/plugins/
directory.Settings > Contact Details
.Here we go:
contact
folder to the /wp-content/plugins/
directory.Settings > Contact Details
.Navigate to the settings page by clicking on Settings
on the left hand menu, and then the Contact Details
option.
Yes, it is possible to modify the contact detail fields using the contact_details
filter.
add_filter( 'contact_details', function( $details ) { // Add a simple text input... $details['twitter'] = __( 'Twitter' ); // Add a new textarea... $details['bank'] = array( 'label' => __( 'Bank' ), 'input' => 'textarea' ); // Remove an existing field... unset( details['fax'] ); // You must always return the modified array... return $details; } );
Current available contact fields are: phone
, fax
, mobile
, email
and address
.
You can use the following function call to output details in your templates:
The fourth parameter passed to contact_detail()
determines whether the value is returned, by setting the value to false.
$phone = contact_detail( 'phone', '<b>', '</b>', false );
The above code will fetch the phone number stored and wrap the response in bold tags.
If you require more customisation that cannot be achieved using CSS, you can define your own template file.
To do this add the the attribute include
to the shortcode tag, e.g. [contact type="form" include="myfile.php"]
.
This file should be placed within your theme directory and should include the processing and output of errors.
I suggest you use the contact.php
file used by the plugin as a starting point / template.
Yes, of course. If you would like to translate this plugin to another language, please provide me with the releavant Poedit files.
I will be certain to include and attribute any contributions to those who provide any translations.
contact-send
filter.spamcheck="false"
.contact_details
now outputs by default instead of having to echo the response.