Customize contact widget

Support Area Forums Foxy Customize contact widget

Viewing 4 posts - 1 through 4 (of 4 total)
URL to the page in question:
  • Author
    Posts
  • #5903
    Tom Druckrey
    Participant

    Hi,

    I have a question concerning the contact widget. Is it possible to add an additional field for a downloadable vcard?

    I’d like to keep everything the way it is, just add a vcard that loads on click?

    Any help on that?

    Thanks so much,

    Tom

    #5926
    Bill Robbins
    Moderator

    Tom,

    Great question. It’s probably easier to hard code the vCard link into the widget than adding in a field directly for it. Here’s what to do:

    1. Go to the appearance section and select edit to open up the theme editor.
    2. From the list of files on your right, choose widget-contact.php and look for this spot:
      
      <?php echo $after_widget; ?>
      
    3. Right above that paste this:

    4. Change the http://www.yourlink.com/ to the URL to your vCard. You can upload it by going to the Media section of your WordPress control panel and selecting “Add New.” Once the upload is finished WordPress will give the URL to your file.
    5. Save your changes.

    That should add in a link for your vCard to the widget.

    Let me know if you run into any trouble.

    Thank you for your business,
    Bill Robbins

    #5941
    Tom Druckrey
    Participant

    Yo Bill!

    Great support, thank you very much – it worked right away. So easy!

    For everyone who might witness similar problems, first I wasn’t able to upload vCards to my media section. It said the file extension cannot be read.

    I added

    add_filter(‘upload_mimes’, ‘custom_upload_mimes’);
    function custom_upload_mimes ( $existing_mimes=array() ) {
    // add your extension to the array
    $existing_mimes[‘vcf’] = ‘text/x-vcard’;
    return $existing_mimes;
    }

    to my functions.php … that solved the problem!

    Best and thanks!!
    Tom

    #5945
    Bill Robbins
    Moderator

    Great solution Tom. Thanks for sharing!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Customize contact widget’ is closed to new replies.