Getting Started with Contact Details

NOTE

This product is no longer sold on WooCommerce.com. This document has been left available for existing users, but will no longer be updated.

Installation

↑ Back to top

Contact Details is a free plugin for displaying contact details on your website. You can install it through your WordPress admin dashboard in Plugins > Add New.

After installing the plugin, you will see a new menu item in your WP dashboard under the Settings -> Contact Details.

Contact Details settings

Adding Contact Details

↑ Back to top

To add contact details, go to Settings > Contact Details:

  1. Add general contact details under the Contact Details tab
  2. Click Save
  3. Add map contact details under the Map Details tab
  4. Click Save

If you leave any of the contact details blank, they will simply not display on the frontend.

Usage

↑ Back to top

You have 3 options for displaying your contact details, you can insert them with a shortcode, widget or insert them directly into a php template file or custom plugin using a template tag/action.

Widget

↑ Back to top

To add your contact details as a widget go to: Appearance > Widgets to find the Contact Details by WooThemes Widget. With this you can modify the following settings:

  1. Title (optional)
  2. Output
    1. All Contact Details
    2. Location Details
    3. Social Media links
    4. Google Map
Contact Details widget

Shortcode

↑ Back to top

To insert contact details into a post or page with a shortcode use the following example as a guide:

[contact_details display="all"]

You can find all of the available parameters listed below. You can simply include these in your shortcode as well.

Please note: You do not need to wrap the parameter for the shortcode in quotes. You should wrap the value in quotes however. Please use the example above as the guide.

PHP

↑ Back to top

To display your contact details via a theme or a custom plugin, please use the following code:

<?php do_action( 'contact_details' ); ?>

Additional Parameters

↑ Back to top

To add arguments to this, please use any of the following arguments, using the syntax provided below:

  • ‘display’ => ‘all’ (outputs all 3 contact details areas)

The various options for the “display” parameter are:

  • ‘all’
  • ‘details’ -> outputs general location details
  • ‘social’ -> outputs links to Twitter and Facebook profiles
  • ‘map’ -> outputs a Google Map of your location
<?php do_action( 'contact_details', array( 'display' => 'details' ) ); ?>

The same arguments apply to the shortcode which is [contact_details] and the template tag, which is <?php contact_details(); ?>.

Usage Examples

↑ Back to top

Adjusting the display output, using the arguments in the 2 possible methods:

do_action() call:

<?php do_action( 'contact_details', array( 'display' => 'details' ) ); ?>

contact_details() template tag:

<?php contact_details( array( 'display' => 'details' ) ); ?>

FAQ

↑ Back to top

The plugin looks unstyled when I activate it. Why is this?

↑ Back to top

“Contact Details by WooThemes” is a lean plugin that aims to keep it’s purpose as clean and clear as possible. Thus, we don’t load any preset CSS styling, to allow full control over the styling within your theme or child theme.

We have a basic tutorial which will help you getting started with styling by applying layout to the contact details output

I need to add my own output to the contact details. How do I do that?

↑ Back to top

Yesiree! You can add in your own custom code before and after each contact details area. Here is a list of the places you can do that:

Before actions
– pre_contact_details_output
– pre_contact_details_location_output
– pre_contact_details_social_output
– pre_contact_details_map_output

After Actions
– post_contact_details_output
– post_contact_details_location_output
– post_contact_details_social_output
– post_contact_details_map_output

Example: To add a custom message before the map area on the frontend, add the following to your themes functions.php file:

add_action( 'pre_contact_details_map_output', 'my_contact_details_map_message' );
function my_contact_details_map_message() {
    $message = '<p>' . __( 'Use this map to visit us!', 'contact-details-by-woothemes' ) . '</p>';
    echo $message;
}

Done!

How do I contribute?

↑ Back to top

We encourage everyone to contribute their ideas, thoughts and code snippets. This can be done by forking the repository over at GitHub.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.