My Company Menu plugin for WordPress
Download My Company Menu plugin for WordPress
This plugin is being submitted to the WordPress repository. For now, you can download it here: mycomp-menu-v1.0.zip
The plugin is now available in the WordPress repository: http://wordpress.org/extend/plugins/my-company-menu/
[hr]
Background and goals of this plugin
This plugin is intended for theme developers who build WordPress websites for other businesses. WordPress has become my CMS of choice for so many reasons, and I find myself exploring ways to give my clients a better experience. The MCM plugin, overall, helps my clients manage their content a little bit easier.
[hr]
My Company Menu tab in admin panel
For starters, MCM adds a new tab in the Admin’s Sidebar, which links to a page to manage standard business contact information and social networking links.
Add your own custom subpages
I also use this new menu to organize Pods, like a Work Portfolio or Team Member Manager. This lets me create custom managers for my client and consolidate them under one menu, keeping the sidebar simple and clean.
Demo page mcm_menu.php
I include a Demo Page (mcm_menu.php located in the plugin directory). If you have no need for additional subpages, just check the Hide Demo Page box on the Help/Settings page to remove it. Otherwise, move mcm_menu.php from Plugins to your Uploads directory to customize it as needed (this will ensure your tweaks remain after an update).
The file mcm_menu.php has ample template functions and recommendations for creating your own custom pages.
[hr]
Customize menu title and icon
Change the menu’s title and icon to match your client’s branding on the Help/Settings Page.
[hr]
Manage company contact information
Give your clients an interface to manage typical contact information, such as:
- Phone number
- Toll free number
- Fax number
- Email address
- Disclaimer
- Physical address
[hr]
Manage social media links
With MCM, just echo the company_social() function in your template file to display icons for fields with a URL. Now, your client can add URLs and the appropriate icons will display automatically.
Supports Google+, Facebook, Twitter, LinkedIn, YouTube, and Vimeo—standard business-related networks.
Icons load as an unordered list with a class of mcm_social. Soon, you will be able to specify your own images.
[hr]
Customize social media icons
New in 1.0.5 Now you can customize the upstate and hover state of your social media icons by using an image sprite.
Just upload your sprite image, specify the width and height of individual icons, and give the background position coordinates for each.
[hr]
Shortcodes and Functions
Each field has a shortcode beneath it that can be used on posts and pages to show the contents of the related input box. Theme developers can use the same shortcode as PHP functions in templates to display the data.
You should verify if each field has a value, then echo something based on success/failure. Each shortcode shares the name of the function for your template pages.
For example, the shortcode for the Company Phone Number is [ company_phone ]. So, incorporate this into your template with:
[php]
<?php
if(company_phone()) { // check if has value
echo company_phone(); // if yes, display value
} // if not, nothing is displayed
?>
[/php]
[php]
<?php
if(company_phone()) { // check if has value
echo company_phone(); // if yes, display value
} else {
echo ‘No phone number entered’; // if not, display message
}
?>
[/php]
The following shortcodes are available at this time.
- Phone Number: [ company_phone ]
- Toll Free Number: [ company_tollfree ]
- Fax Number: [ company_fax ]
- Email Address: [ company_email ]
- Disclaimer: [ company_disclaimer ]
- Address (multi-line): [ company_address ]
- Address (one line): [ company_address_oneline ]
- Google Plus: [ company_gplus ]
- Facebook: [ company_facebook ]
- LinkedIn: [ company_linkedin ]
- Twitter: [ company_twitter ]
- YouTube: [ company_youtube ]
- Vimeo: [ company_vimeo ]
- RSS Feed: [ company_rss ]
- List social icons: [ company_social ]
[hr]
TinyMCE integration
Easily add the company’s phone number or email address into a post by clicking the new buttons in your WYSIWYG editor.
[hr]
Future goals of this plugin
- Custom social media icons
- Interface for adding Pods as subpages (currently a manual process in mcm_menu.php)
- Google Maps integration
Warning: include(../wp-content/plugins/mycomp-menu/mcm_menu.php) [function.include]: failed to open stream: No such file or directory in /home/luchosar/public_html/wp4/wp-content/plugins/my-company-menu/mycomp_menu.php on line 136
Thanks for the bug; the repository used a different directory name than I had intended. The fix has been committed (v1.0.2), and you should see it soon.
Has there been any further development on getting Google Maps integrated? Or the ability to create additional fields for the company?
Thanks!
@Chip – Unfortunately, personal projects get backburnered in favor of client work. I use this plugin on nearly every WordPress we do, so it’s on my list!
Hi Jason,
I just downloaded your plugin to try. Looks very promising!
I need to add custom field like..
Slogan 1
Slogan 2 , etc.
Where do I add that to the php code?
Thank you,have a great day also!
Brent
@Brent,
Sorry for the delay. Do this:
In mycomp_menu.php:
In mycomp_menu_markup.php:
In mycomp_menu_form_process:
And that should cover it. You’ll want to deactivate/reactivate the plugin again to see your changes. Hope this helps!
Hello, great plugin. I am wondering if there are shortcodes or template functions to retrieve the individual physical address fields, rather than all of them at once.
Also, I wanted to just point out that the company address shortcode/template functions output the content within an HTML tag. I’m sure its debatable, but this is not really the correct usage of that tag. The current spec says this tag should only contain a physical address if it is part of the contact information of the document/article owner. So this may be the case in some instances, but the physical address should not be itself isolated in an tag.
Thanks