Web Development Blog

Woocommerce Shortcode to Display All Products

October 28th, 2015

Here is how to get a Woocommerce shortcode to show all products on a page.

I’ve searched and searched, and it appears Woocommerce doesn’t have an official way to do this.

But no worries, I’m going to tell you exactly how to set this up so that you can add a filter that will allow you to use the native Woocommerce shortcode to display all products.

  1. Okay, so the first step is to open up your theme’s function file (functions.php).

    Open this up in a text editor or your favorite HTML editor. I use Notepad++ because it’s awesome! And yes, I do hand code most stuff.

  2. With the functions file open, go to the bottom of the file and add the following code.
    /* Add Show All Products to Woocommerce Shortcode */
    function woocommerce_shortcode_display_all_products($args)
    {
     if(strtolower(@$args['post__in'][0])=='all')
     {
      global $wpdb;
      $args['post__in'] = array();
      $products = $wpdb->get_results("SELECT ID FROM ".$wpdb->posts." WHERE `post_type`='product'",ARRAY_A);
      foreach($products as $k => $v) { $args['post__in'][] = $products[$k]['ID']; }
     }
     return $args;
    }
    add_filter('woocommerce_shortcode_products_query', 'woocommerce_shortcode_display_all_products');
  3. Save the file and re-upload to your server.

You can now use the follow shortcode to display all Woocommerce products.

[products ids="all"]

How this works is that when you call the official Woocommerce shortcode for displaying products ([products ids=""]) that script is triggered using WordPress’s filter & hooks features.

When the filter script is triggered, it queries the database for all your merchandise and compiles a list of their product IDs.

Then the filter the complied goods’ IDs to the attribute option of the Woocommerce products shortcode.

Since that shortcode allows you to list all stock by ID or SKU (and our filter script adds all IDs to the code’s options) you can now use the shortcode to list all products.

The shortcode will still function as it works by default. Only when you add the all to the ID options for the code will it then show all products.

Note that order by feature still works. For example: [products id="all" orderby="menu_order"]

If you need help or just want to thank me, submit a comment below.

5 Things Your Website Needs To Get The Most Out of It

August 6th, 2014

Most of the time you might think of our company website as simply an informational “brochure”, but the fact is is that your website is there 247, and is much more than informational, it’s an incredible marketing tool! Think of how many employees you have that are willing to be there 247 and provide the exact information about your company in the exactly way you want it presented. So here are at least 5 things your website should have to get you the most out of it.

1. Blog – You need to have a blog and you need to post to it regularly as well as have a link to it from your website. Naturally, the blog will promote itself by being found on your website and when performing related searches in search engines, such as Google. However, the main thing is that you could use your blog to strengthen your relationship with prospects and current customers. What you should do is send prospects & current customers emails with links to posts you write for your blog. When you write a post that is relevant to a prospect or customer, you should send them a link to it via email, etc. On top of that, simply having the blog assessable from your website will allow potential and existing customers to find and read your more about you and your company on a more personal level. Simply stated this keeps you in front of and on the mind of your customers and prospective clients.

2. Call to Action – How good do you think an advertisement would work if you never instructed the prospective customer to buy your product. That’s what you’re doing on your website if you don’t have a call-to-action statement. A call-to-action statement tells your visitor to take some type of action. In most cases, you want them to contact you. The call-to-action should be the main focus of your website. Do this exercise, look at your website and then ask yourself what you want people to do when they visit your website. What would be the ideal situation? Would it be they contact you for business, sign up for a free trial, etc.

3. Good Design – There have been numerous studies that show a better design correlates to an improved perspective of your company. Just think about it, would you be more willing to buy from a website that looked like a 5-year-old put it together or one that was professional and gave you that “wow” feeling when you looked at it.

4. SEO Basics – Every site should at least have the basics in place for search engines. These basics make sure your site can be found and indexed properly by search engines and many times having these basics in place alone will propel your site to the top of searches in Google for particular search phrases.

5. Contact Info – You must have your company’s contact info on your site in an easily accessible way. Moreover, I would go so far as to say you need to have it on every page in a place that’s logical to find. The worst thing would be for a prospective customer not to reach out to you for a purchase just because they could not find your contact information.

6. Well Written Code – This is a bonus item. Honestly most people will never see your site’s code. So why would I say this is important. For a few reasons. For one, having well-written website code allows your site to be upgraded and changed much more efficiently. Well-written code also enables your website to perform and look correctly on most computers and smart phones. You may not know this, but computer monitors come in all shapes and sizes which do affect how your website will look. Some people only have so much restate on their monitor and others have an enormous screen. Making sure your site’s code is optimized for all these viewing sizes and different types of Internet browser (such as Internet Explorer, Firefox, Google Chrome, Safari, etc) makes a big impact on your visitor. Same goes for mobile browsing. If you website isn’t viewable or doesn’t function in the most readily used monitor sizes, versions of Internet browsers and mobile phones you’re losing traffic on your site and worse yet, can be losing customers.

Make Dropit jQuery Dropdowns Close on MouseOut

January 30th, 2014

I’ve recently stumbled upon Dropit dropdowns plugin for jQuery. It’s a great, simple dropdown script that you can quickly implement. But I’ve found it was missing one thing. How to make Dropit jQuery dropdowns close on mouseout. So I’ve created a little script that makes the dropdown close when you mouse out or hover off the menu and sub menus. Just add the following in your dropit.js file right before the commented line “// Close if outside click“.

Code to Add:

// Close if mouse outside
$el.mouseleave(function() {
settings.beforeHide.call(this);
$('.dropit-open').removeClass('dropit-open').find('.dropit-submenu').hide();
settings.afterHide.call(this);
});

Download dropit.js with changes.

jQuery Input Type Selectors for HTML5

November 11th, 2012

As many of you have noticed,  jQuery doesn’t allow you to select HTML 5 input elements with the standard colon selection type, like this :date

So what you can do is use brackets to define the input type you want to select. Here is what I came up with. This should include most if not all HTML5 input types.

$(':text, [type=date], [type=time], [type=search] ,[type=number] ,[type=email] ,[type=datetime] ,[type=datetime-local] ,[type=month] ,[type=week] ,[type=time] ,[type=tel] ,[type=url] ,[type=color] ,[type=range]').each(function()

 {
  // add what you want to do here
 });

IE7 & IE6 url(data: Produces Nonsecure Items Warning

July 5th, 2012

IE6 and IE7 don’t play nice with the use of url(data: in css stylesheets. It took me quite a while to narrow down on what was causing the “This page contains both secure and nonsecure items” message in IE7. Both Firefox and Chrome has no issue with a secure page I was developing. It turns out that IE6 and IE7 have a bug .

What lead me to understanding this issue was a post at stackoverflow.com. A user there mentioned that Eric Lawrence, a Microsoft employee who worked on developing IE6 & 7, stated:

Other quirks to be aware of: In IE6, we treat “about:blank” as insecure content, as well as “javascript:” and “res:”. In IE7, we fixed the “about:blank” case, but we have not (yet) changed javascript and res.

This lead me to think well… maybe there is something else they missed. So I hunted down through my code and tested each part by removing bits and pieces until I discoverted it was the url(data: tag for a background in a css stylesheet.

My solution is to provide a separate stylesheet for IE6 & 7 that overwrites the url data tag. More solutions for this can be found here, IE7 and url(data:=…) via https gives mixed content warning.

FYI, here is a great reference on CSS Specific Rules for Internet Explorer – these can help in overwriting the url data tag.

IE7 and url(data:=...) via https gives mixed content warning

Check for Cookies Enabled

September 11th, 2011

I recently needed to check and see if cookies were enabled for a script that I was writing for authenticating a user login. I quickly realized all the problems with this I had forgot as I don’t normally set cookies but rather normally use sessions.

Problems to overcome:

  1. Can’t check for a cookie when first setting the cookie - you have to reload the page to check for it. It would make sense to set a cookie and then in your next lines of code to check if there is a cookie, thus telling you cookies are enabled if you can pull the cookie back up. Unfortunately that will not work, you have to reload the page to check for the cookie. So this method is not a good one for what I’m doing.
  2. Don’t have to reload the browser – since about I pointed out that I have to reload a page to check for a cookie I just set I’d like to find a method were I don’t have to reload the page.
  3. No JavaScript enabled – would like to check for cookies with JavaScript. Although is not absolutely necessary for my needs so if I have to I’ll check it with JavaScript.

What I came up with:

I found several ways to check for cookies with both JavaScript and at least one way with PHP.

JavaScript:

var cookiesEnabled = (navigator.cookiesEnabled) ? true : false;

PHP:

setcookie("cookiesEnabled",1,time()+3600*24);
// Above cookie expires in 24 hours
// Next you have to reload the page to test the next part, so on first load below will give false even if cookies is enabled
$cookiesEnabled = (isset($_COOKIE['cookiesEnabled'])) ? true : fasle;

Best Method:

Below are the best methods I could come up with. I’ve create both a PHP and Javascript method. JavaScript should be cross-browser safe. Although PHP does rely on that the page being reloaded – which for a login page that should be the case.

Using JavaScript:

function isCookiesEnabled()
{
 var cookiesEnabled = (navigator.cookiesEnabled) ? true : false;
 if(typeof navigator.cookiesEnabled=="undefined" && !cookiesEnabled)
 {
  document.cookie="testcookie";
  cookiesEnabled = (document.cookie.indexOf("testcookie") != -1) ? true : false;
 }
 return (cookiesEnabled);
}

Using PHP:

// Setup Cookies Enabled Check
setcookie("cookiesEnabled",1,time()+3600*24,'/','.'.$_SERVER['SERVER_NAME']); // set for 24 hours

// Check Cookies Enabled
 $cookiesEnabled = (isset($_COOKIE['cookieEnabled'])) ? true : false;

Netflix Instant Play Bugs – Buffer Rate Issues & More

June 27th, 2011

Being a web developer I’m well aware that sites developed need to be checked over with a fine-tooth-comb for bug and potential issues. In fact there are even many times when you can check for bugs and even check the site in many different Internet browsers (such as Firefox, Internet Explorer, Google Chrome, Safari, ect…) and still miss things just because your computer might have some slightly different settings which make some sort of bug not present on your computer but still show up on many of the end users’ computers. It bites! But one successful thing is to listen to users and investigate what they report. I’ve found most of the time the user is correct even if I could not reproduce the issue on my end – it usually turns out other people are having the same issue and just didn’t speak up about it.

So with that said I’m hoping someone from Netflix (particular the web development or engineering team) will look this blog post over, take it to heart and investigate these issues. I became a Netflix member about 2 months ago and so far like the service but the bugs I found make it almost impossible to watch anything “Instant” unless you want to spend extra time trying to combat bugs and are forced to refresh the page many times and keep fiddling with the Silverlight settings.

So to get on with it, here are several bugs I’ve found with the Netflix Silverlight player. These are issues not specific to any one video but rather issues experienced them on numerous videos as well as in several browsers (Firefox, IE and Chrome).

1. The buffer rate and play rate tend to become the same rate. This means when you try to play something it’s buffering at the same rate it’s playing – thus choppy video! The buffer rate should be bigger than the play rate in order to keep the video buffered enough in advance so the play back is smooth. I’ve even tried to manually change the buffer rate (via the Silverlight setting, shift + alt + right click) and moved the video playback track around so the new buffer rate would take effect (another trick I’ve found you have to do) plus enabling the GPU Acceleration but that only helps for a little while and the rates eventually match each other again and cause playback issues.

2. Also recently (similar to he above issue) it seems there is some other play back or buffering issues going on too. As I’ve noticed that when you first start a video it plays for a few minutes or so and then has to buffer/load but the buffer time starts out loading at a good speed but then slows down and takes for ever to buffer/load. But if I just refresh when this happens the page the load/buffer time is considerably quicker. So there is something going on with buffering.

3. There are some issues with the player going full screen and back to normal. Sometimes I’ll get a tiled view (or like window blinds, see picture below) where the picture is distorted horizontally. Sometimes it happens when I click full screen, other times when I click to exit full screen (or click Esc button on keyword). This does not happen all the time but usually is corrected by clicking full screen then existing full screen and back again several times until picture looks normal.

Netflix bug - window blinds

4. Can’t change play track position while loading/buffering (aka, during the screen with the red loading bar going across video). When the video is loading/buffering (even when video stops during play back to load/buffer video) I can’t change the play track position. The video track and all other Silverlight features (can’t use shift + alt + right click) are locked. This is a pain if you want to change the video track (position in video were you are playing from) and the loading/buffering bar is there as you have to wait till it’s done which could take a while then you click to another point on the video track and it’s got to do it all over again (same if need to change a setting in Sliverlight)… aggg

5. More things to come as I find them… above are 4 of the most important for now.

Also if you know of anything please feel free to post your bugs/issues in the comments. Hopefully this will at least get these above items fixed.

[FIXED] ib is null – ibrowser Plugin for TinyMCE

January 21st, 2011

I, like you, have run into the problem of ibrowser not working for Firefox (FF3). This is a pain as it seems like a great free image uploaded/manager for TinyMCE. The problem I kept running it is that after installing ibrowser and then testing it out, is that the icon to open up the popup for this plugin does nothing. Under further investigation I discovered I was getting a JavaScript error “ib is null“.

Well, so I search Google and found some people saying to add “var ib = null;” (no quotes) to the beginning of the editor_plugin.js. I opened my editor_plugin.js file and see that for my version this bug fix is already in there (aka ib = null; as already pasted into the beginning of this file). So back to square one, problem still not solved.

Then I looked through the code and found that the issue seems to be that on line 14 (of my version) which reads tinymce.ScriptLoader.load(url + ‘/interface/common.js’); this is not actually loading the script. So I just commented that line out and copied and pasted that whole script under that line.

That seemed to work and I got the ibrowser to open and upload images. But it would now not insert the image into the editor when you click the insert button. And I saw that I was getting the JavaScript error “opner.ibrowser_callback is not a function” now.

So this copy and paste method was not really working. I realized then that if the problem is that its just not loading the script then I should add in some code that will load the script for me.

[SOLUTION]

I’m luckly already using jQuery so I just did the following:

  1. In the file editor_plugin.js (located in ibrowser root plugin folder) commented out the line:
    tinymce.ScriptLoader.load(url + '/interface/common.js');
  2. Added the following line after that:
    $.getScript(url+'/interface/common.js'); // BUG FIX by Sean Gallagher www.GallagherWebsiteDesign.com
  3. Do the same as the above 2 steps for editor_plugin_src.js file as well
  4. That’s it! Upload editor_plugin.js and editor_plugin_src.js to your server and your done.

For non-iQuery users try the following solution – I’ve not tried this but others said it worked.

  1. In the file editor_plugin.js (located in ibrowser root plugin folder) commented out the line:
    tinymce.ScriptLoader.load(url + '/interface/common.js');
  2. Added the following line after that:
    tinymce.ScriptLoader.add(url + '/interface/common.js'); tinymce.ScriptLoader.loadQueue();
  3. Do the same as the above 2 steps for editor_plugin_src.js file as well
  4. That’s it… for more on this solution check out the TinyMCE forum thread for this (this solution is on the last page of that thread).

For more on jQUery script loading check out the getScript function.

To download ibrowser visit visions4net.com’s download page.

To download TinyMCE check out the TinyMCE home page.

HTML State Dropdown List with PHP Dynamic Select

July 15th, 2010

I’m always running into a project were I am setting up a sign up form or something and need a HTML state dropdown list for the 50 US states but also needs to include a PHP based dynamicly select/checked based on what the user submited. For example, when someone submits a form and it faild validation and you want to show the form again but don’t want the user to have to reselect that checkbox, select option or radio option again. This handy script dynamically checks/selects the right one based off what the user submitted.

I’m giving this script out since it will also give me a reference to quickly use it myself in projects as well as provided it to you.

So here goes… The following first code is my custom PHP function for making a checkbox, select or radio field checked dynamically based on what was submitted. Then following that is the 50 U.S. states dropdown list in both an abbreviation and non abbreviation format. As an added bonus I’ve also included a select dropdown list for countries.

PHP Function


<?php
############################
# Dynamic Form Fields Func #
############################
function dynField($option,$value,$type)
{
 if($type=='checkbox' && @in_array($value,$option)) { echo ' CHECKED'; return; }
 if($option==$value)
 {
  if($type=='option') { echo ' SELECTED'; }
  if($type=='radio') { echo ' CHECKED'; }
 }
}
?>

HTML Select Dropdown

States Non-Abbreviated Format


<select name="state">
 <option value="AL"<?php dynField(@$state,'AL','option'); ?>>Alabama</option>
 <option value="AK"<?php dynField(@$state,'AK','option'); ?>>Alaska</option>
 <option value="AZ"<?php dynField(@$state,'AZ','option'); ?>>Arizona</option>
 <option value="AR"<?php dynField(@$state,'AR','option'); ?>>Arkansas</option>
 <option value="CA"<?php dynField(@$state,'CA','option'); ?>>California</option>
 <option value="CO"<?php dynField(@$state,'CO','option'); ?>>Colorado</option>
 <option value="CT"<?php dynField(@$state,'CT','option'); ?>>Connecticut</option>
 <option value="DE"<?php dynField(@$state,'DE','option'); ?>>Delaware</option>
 <option value="DC"<?php dynField(@$state,'DC','option'); ?>>District of Columbia</option>
 <option value="FL"<?php dynField(@$state,'FL','option'); ?>>Florida</option>
 <option value="GA"<?php dynField(@$state,'GA','option'); ?>>Georgia</option>
 <option value="HI"<?php dynField(@$state,'HI','option'); ?>>Hawaii</option>
 <option value="ID"<?php dynField(@$state,'ID','option'); ?>>Idaho</option>
 <option value="IL"<?php dynField(@$state,'IL','option'); ?>>Illinois</option>
 <option value="IN"<?php dynField(@$state,'IN','option'); ?>>Indiana</option>
 <option value="IA"<?php dynField(@$state,'IA','option'); ?>>Iowa</option>
 <option value="KS"<?php dynField(@$state,'KS','option'); ?>>Kansas</option>
 <option value="KY"<?php dynField(@$state,'KY','option'); ?>>Kentucky</option>
 <option value="LA"<?php dynField(@$state,'LA','option'); ?>>Louisiana</option>
 <option value="ME"<?php dynField(@$state,'ME','option'); ?>>Maine</option>
 <option value="MD"<?php dynField(@$state,'MD','option'); ?>>Maryland</option>
 <option value="MA"<?php dynField(@$state,'MA','option'); ?>>Massachusetts</option>
 <option value="MI"<?php dynField(@$state,'MI','option'); ?>>Michigan</option>
 <option value="MN"<?php dynField(@$state,'MN','option'); ?>>Minnesota</option>
 <option value="MS"<?php dynField(@$state,'MS','option'); ?>>Mississippi</option>
 <option value="MO"<?php dynField(@$state,'MO','option'); ?>>Missouri</option>
 <option value="MT"<?php dynField(@$state,'MT','option'); ?>>Montana</option>
 <option value="NE"<?php dynField(@$state,'NE','option'); ?>>Nebraska</option>
 <option value="NV"<?php dynField(@$state,'NV','option'); ?>>Nevada</option>
 <option value="NH"<?php dynField(@$state,'NH','option'); ?>>New Hampshire</option>
 <option value="NJ"<?php dynField(@$state,'NJ','option'); ?>>New Jersey</option>
 <option value="NM"<?php dynField(@$state,'NM','option'); ?>>New Mexico</option>
 <option value="NY"<?php dynField(@$state,'NY','option'); ?>>New York</option>
 <option value="NC"<?php dynField(@$state,'NC','option'); ?>>North Carolina</option>
 <option value="ND"<?php dynField(@$state,'ND','option'); ?>>North Dakota</option>
 <option value="OH"<?php dynField(@$state,'OH','option'); ?>>Ohio</option>
 <option value="OK"<?php dynField(@$state,'OK','option'); ?>>Oklahoma</option>
 <option value="OR"<?php dynField(@$state,'OR','option'); ?>>Oregon</option>
 <option value="PA"<?php dynField(@$state,'PA','option'); ?>>Pennsylvania</option>
 <option value="RI"<?php dynField(@$state,'RI','option'); ?>>Rhode Island</option>
 <option value="SC"<?php dynField(@$state,'SC','option'); ?>>South Carolina</option>
 <option value="SD"<?php dynField(@$state,'SD','option'); ?>>South Dakota</option>
 <option value="TN"<?php dynField(@$state,'TN','option'); ?>>Tennessee</option>
 <option value="TX"<?php dynField(@$state,'TX','option'); ?>>Texas</option>
 <option value="UT"<?php dynField(@$state,'UT','option'); ?>>Utah</option>
 <option value="VT"<?php dynField(@$state,'VT','option'); ?>>Vermont</option>
 <option value="VA"<?php dynField(@$state,'VA','option'); ?>>Virginia</option>
 <option value="WA"<?php dynField(@$state,'WA','option'); ?>>Washington</option>
 <option value="WV"<?php dynField(@$state,'WV','option'); ?>>West Virginia</option>
 <option value="WI"<?php dynField(@$state,'WI','option'); ?>>Wisconsin</option>
 <option value="WY"<?php dynField(@$state,'WY','option'); ?>>Wyoming</option>
</select>

States Abbreviated Format


<select name="state">
 <option value="AL"<?php dynField(@$state,'AL','option'); ?>>AL</option>
 <option value="AK"<?php dynField(@$state,'AK','option'); ?>>AK</option>
 <option value="AZ"<?php dynField(@$state,'AZ','option'); ?>>AZ</option>
 <option value="AR"<?php dynField(@$state,'AR','option'); ?>>AR</option>
 <option value="CA"<?php dynField(@$state,'CA','option'); ?>>CA</option>
 <option value="CO"<?php dynField(@$state,'CO','option'); ?>>CO</option>
 <option value="CT"<?php dynField(@$state,'CT','option'); ?>>CT</option>
 <option value="DE"<?php dynField(@$state,'DE','option'); ?>>DE</option>
 <option value="DC"<?php dynField(@$state,'DC','option'); ?>>DC</option>
 <option value="FL"<?php dynField(@$state,'FL','option'); ?>>FL</option>
 <option value="GA"<?php dynField(@$state,'GA','option'); ?>>GA</option>
 <option value="HI"<?php dynField(@$state,'HI','option'); ?>>HI</option>
 <option value="ID"<?php dynField(@$state,'ID','option'); ?>>ID</option>
 <option value="IL"<?php dynField(@$state,'IL','option'); ?>>IL</option>
 <option value="IN"<?php dynField(@$state,'IN','option'); ?>>IN</option>
 <option value="IA"<?php dynField(@$state,'IA','option'); ?>>IA</option>
 <option value="KS"<?php dynField(@$state,'KS','option'); ?>>KS</option>
 <option value="KY"<?php dynField(@$state,'KY','option'); ?>>KY</option>
 <option value="LA"<?php dynField(@$state,'LA','option'); ?>>LA</option>
 <option value="ME"<?php dynField(@$state,'ME','option'); ?>>ME</option>
 <option value="MD"<?php dynField(@$state,'MD','option'); ?>>MD</option>
 <option value="MA"<?php dynField(@$state,'MA','option'); ?>>MA</option>
 <option value="MI"<?php dynField(@$state,'MI','option'); ?>>MI</option>
 <option value="MN"<?php dynField(@$state,'MN','option'); ?>>MN</option>
 <option value="MS"<?php dynField(@$state,'MS','option'); ?>>MS</option>
 <option value="MO"<?php dynField(@$state,'MO','option'); ?>>MO</option>
 <option value="MT"<?php dynField(@$state,'MT','option'); ?>>MT</option>
 <option value="NE"<?php dynField(@$state,'NE','option'); ?>>NE</option>
 <option value="NV"<?php dynField(@$state,'NV','option'); ?>>NV</option>
 <option value="NH"<?php dynField(@$state,'NH','option'); ?>>NH</option>
 <option value="NJ"<?php dynField(@$state,'NJ','option'); ?>>NJ</option>
 <option value="NM"<?php dynField(@$state,'NM','option'); ?>>NM</option>
 <option value="NY"<?php dynField(@$state,'NY','option'); ?>>NY</option>
 <option value="NC"<?php dynField(@$state,'NC','option'); ?>>NC</option>
 <option value="ND"<?php dynField(@$state,'ND','option'); ?>>ND</option>
 <option value="OH"<?php dynField(@$state,'OH','option'); ?>>OH</option>
 <option value="OK"<?php dynField(@$state,'OK','option'); ?>>OK</option>
 <option value="OR"<?php dynField(@$state,'OR','option'); ?>>OR</option>
 <option value="PA"<?php dynField(@$state,'PA','option'); ?>>PA</option>
 <option value="RI"<?php dynField(@$state,'RI','option'); ?>>RI</option>
 <option value="SC"<?php dynField(@$state,'SC','option'); ?>>SC</option>
 <option value="SD"<?php dynField(@$state,'SD','option'); ?>>SD</option>
 <option value="TN"<?php dynField(@$state,'TN','option'); ?>>TN</option>
 <option value="TX"<?php dynField(@$state,'TX','option'); ?>>TX</option>
 <option value="UT"<?php dynField(@$state,'UT','option'); ?>>UT</option>
 <option value="VT"<?php dynField(@$state,'VT','option'); ?>>VT</option>
 <option value="VA"<?php dynField(@$state,'VA','option'); ?>>VA</option>
 <option value="WA"<?php dynField(@$state,'WA','option'); ?>>WA</option>
 <option value="WV"<?php dynField(@$state,'WV','option'); ?>>WV</option>
 <option value="WI"<?php dynField(@$state,'WI','option'); ?>>WI</option>
 <option value="WY"<?php dynField(@$state,'WY','option'); ?>>WY</option>
</select>

Country List


<select name="country">
 <option value="AF"<?php dynField(@$country,'AF','option'); ?>>Afghanistan</option>
 <option value="AL"<?php dynField(@$country,'AL','option'); ?>>Albania</option>
 <option value="DZ"<?php dynField(@$country,'DZ','option'); ?>>Algeria</option>
 <option value="AS"<?php dynField(@$country,'AS','option'); ?>>American Samoa</option>
 <option value="AD"<?php dynField(@$country,'AD','option'); ?>>Andorra</option>
 <option value="AO"<?php dynField(@$country,'AO','option'); ?>>Angola</option>
 <option value="AI"<?php dynField(@$country,'AI','option'); ?>>Anguilla</option>
 <option value="AQ"<?php dynField(@$country,'AQ','option'); ?>>Antarctica</option>
 <option value="AG"<?php dynField(@$country,'AG','option'); ?>>Antigua and Barbuda</option>
 <option value="AR"<?php dynField(@$country,'AR','option'); ?>>Argentina</option>
 <option value="AM"<?php dynField(@$country,'AM','option'); ?>>Armenia</option>
 <option value="AW"<?php dynField(@$country,'AW','option'); ?>>Aruba</option>
 <option value="AU"<?php dynField(@$country,'AU','option'); ?>>Australia</option>
 <option value="AT"<?php dynField(@$country,'AT','option'); ?>>Austria</option>
 <option value="AZ"<?php dynField(@$country,'AZ','option'); ?>>Azerbaijan</option>
 <option value="BS"<?php dynField(@$country,'BS','option'); ?>>Bahamas</option>
 <option value="BH"<?php dynField(@$country,'BH','option'); ?>>Bahrain</option>
 <option value="BD"<?php dynField(@$country,'BD','option'); ?>>Bangladesh</option>
 <option value="BB"<?php dynField(@$country,'BB','option'); ?>>Barbados</option>
 <option value="BY"<?php dynField(@$country,'BY','option'); ?>>Belarus</option>
 <option value="BE"<?php dynField(@$country,'BE','option'); ?>>Belgium</option>
 <option value="BZ"<?php dynField(@$country,'BZ','option'); ?>>Belize</option>
 <option value="BJ"<?php dynField(@$country,'BJ','option'); ?>>Benin</option>
 <option value="BM"<?php dynField(@$country,'BM','option'); ?>>Bermuda</option>
 <option value="BT"<?php dynField(@$country,'BT','option'); ?>>Bhutan</option>
 <option value="BO"<?php dynField(@$country,'BO','option'); ?>>Bolivia</option>
 <option value="BA"<?php dynField(@$country,'BA','option'); ?>>Bosnia and Herzegowina</option>
 <option value="BW"<?php dynField(@$country,'BW','option'); ?>>Botswana</option>
 <option value="BV"<?php dynField(@$country,'BV','option'); ?>>Bouvet Island</option>
 <option value="BR"<?php dynField(@$country,'BR','option'); ?>>Brazil</option>
 <option value="IO"<?php dynField(@$country,'IO','option'); ?>>British Indian Ocean Territory</option>
 <option value="BN"<?php dynField(@$country,'BN','option'); ?>>Brunei Darussalam</option>
 <option value="BG"<?php dynField(@$country,'BG','option'); ?>>Bulgaria</option>
 <option value="BF"<?php dynField(@$country,'BF','option'); ?>>Burkina Faso</option>
 <option value="BI"<?php dynField(@$country,'BI','option'); ?>>Burundi</option>
 <option value="KH"<?php dynField(@$country,'KH','option'); ?>>Cambodia</option>
 <option value="CM"<?php dynField(@$country,'CM','option'); ?>>Cameroon</option>
 <option value="CA"<?php dynField(@$country,'CA','option'); ?>>Canada</option>
 <option value="CV"<?php dynField(@$country,'CV','option'); ?>>Cape Verde</option>
 <option value="KY"<?php dynField(@$country,'KY','option'); ?>>Cayman Islands</option>
 <option value="CF"<?php dynField(@$country,'CF','option'); ?>>Central African Republic</option>
 <option value="TD"<?php dynField(@$country,'TD','option'); ?>>Chad</option>
 <option value="CL"<?php dynField(@$country,'CL','option'); ?>>Chile</option>
 <option value="CN"<?php dynField(@$country,'CN','option'); ?>>China</option>
 <option value="CX"<?php dynField(@$country,'CX','option'); ?>>Christmas Island</option>
 <option value="CC"<?php dynField(@$country,'CC','option'); ?>>Cocos (Keeling) Islands</option>
 <option value="CO"<?php dynField(@$country,'CO','option'); ?>>Colombia</option>
 <option value="KM"<?php dynField(@$country,'KM','option'); ?>>Comoros</option>
 <option value="CG"<?php dynField(@$country,'CG','option'); ?>>Congo</option>
 <option value="CD"<?php dynField(@$country,'CD','option'); ?>>Congo, the Democratic Republic of the</option>
 <option value="CK"<?php dynField(@$country,'CK','option'); ?>>Cook Islands</option>
 <option value="CR"<?php dynField(@$country,'CR','option'); ?>>Costa Rica</option>
 <option value="CI"<?php dynField(@$country,'CI','option'); ?>>Cote d'Ivoire</option>
 <option value="HR"<?php dynField(@$country,'HR','option'); ?>>Croatia (Hrvatska)</option>
 <option value="CU"<?php dynField(@$country,'CU','option'); ?>>Cuba</option>
 <option value="CY"<?php dynField(@$country,'CY','option'); ?>>Cyprus</option>
 <option value="CZ"<?php dynField(@$country,'CZ','option'); ?>>Czech Republic</option>
 <option value="DK"<?php dynField(@$country,'DK','option'); ?>>Denmark</option>
 <option value="DJ"<?php dynField(@$country,'DJ','option'); ?>>Djibouti</option>
 <option value="DM"<?php dynField(@$country,'DM','option'); ?>>Dominica</option>
 <option value="DO"<?php dynField(@$country,'DO','option'); ?>>Dominican Republic</option>
 <option value="TP"<?php dynField(@$country,'TP','option'); ?>>East Timor</option>
 <option value="EC"<?php dynField(@$country,'EC','option'); ?>>Ecuador</option>
 <option value="EG"<?php dynField(@$country,'EG','option'); ?>>Egypt</option>
 <option value="SV"<?php dynField(@$country,'SV','option'); ?>>El Salvador</option>
 <option value="GQ"<?php dynField(@$country,'GQ','option'); ?>>Equatorial Guinea</option>
 <option value="ER"<?php dynField(@$country,'ER','option'); ?>>Eritrea</option>
 <option value="EE"<?php dynField(@$country,'EE','option'); ?>>Estonia</option>
 <option value="ET"<?php dynField(@$country,'ET','option'); ?>>Ethiopia</option>
 <option value="FK"<?php dynField(@$country,'FK','option'); ?>>Falkland Islands (Malvinas)</option>
 <option value="FO"<?php dynField(@$country,'FO','option'); ?>>Faroe Islands</option>
 <option value="FJ"<?php dynField(@$country,'FJ','option'); ?>>Fiji</option>
 <option value="FI"<?php dynField(@$country,'FI','option'); ?>>Finland</option>
 <option value="FR"<?php dynField(@$country,'FR','option'); ?>>France</option>
 <option value="FX"<?php dynField(@$country,'FX','option'); ?>>France, Metropolitan</option>
 <option value="GF"<?php dynField(@$country,'GF','option'); ?>>French Guiana</option>
 <option value="PF"<?php dynField(@$country,'PF','option'); ?>>French Polynesia</option>
 <option value="TF"<?php dynField(@$country,'TF','option'); ?>>French Southern Territories</option>
 <option value="GA"<?php dynField(@$country,'GA','option'); ?>>Gabon</option>
 <option value="GM"<?php dynField(@$country,'GM','option'); ?>>Gambia</option>
 <option value="GE"<?php dynField(@$country,'GE','option'); ?>>Georgia</option>
 <option value="DE"<?php dynField(@$country,'DE','option'); ?>>Germany</option>
 <option value="GH"<?php dynField(@$country,'GH','option'); ?>>Ghana</option>
 <option value="GI"<?php dynField(@$country,'GI','option'); ?>>Gibraltar</option>
 <option value="GR"<?php dynField(@$country,'GR','option'); ?>>Greece</option>
 <option value="GL"<?php dynField(@$country,'GL','option'); ?>>Greenland</option>
 <option value="GD"<?php dynField(@$country,'GD','option'); ?>>Grenada</option>
 <option value="GP"<?php dynField(@$country,'GP','option'); ?>>Guadeloupe</option>
 <option value="GU"<?php dynField(@$country,'GU','option'); ?>>Guam</option>
 <option value="GT"<?php dynField(@$country,'GT','option'); ?>>Guatemala</option>
 <option value="GN"<?php dynField(@$country,'GN','option'); ?>>Guinea</option>
 <option value="GW"<?php dynField(@$country,'GW','option'); ?>>Guinea-Bissau</option>
 <option value="GY"<?php dynField(@$country,'GY','option'); ?>>Guyana</option>
 <option value="HT"<?php dynField(@$country,'HT','option'); ?>>Haiti</option>
 <option value="HM"<?php dynField(@$country,'HM','option'); ?>>Heard and Mc Donald Islands</option>
 <option value="VA"<?php dynField(@$country,'VA','option'); ?>>Holy See (Vatican City State)</option>
 <option value="HN"<?php dynField(@$country,'HN','option'); ?>>Honduras</option>
 <option value="HK"<?php dynField(@$country,'HK','option'); ?>>Hong Kong</option>
 <option value="HU"<?php dynField(@$country,'HU','option'); ?>>Hungary</option>
 <option value="IS"<?php dynField(@$country,'IS','option'); ?>>Iceland</option>
 <option value="IN"<?php dynField(@$country,'IN','option'); ?>>India</option>
 <option value="ID"<?php dynField(@$country,'ID','option'); ?>>Indonesia</option>
 <option value="IR"<?php dynField(@$country,'IR','option'); ?>>Iran (Islamic Republic of)</option>
 <option value="IQ"<?php dynField(@$country,'IQ','option'); ?>>Iraq</option>
 <option value="IE"<?php dynField(@$country,'IE','option'); ?>>Ireland</option>
 <option value="IL"<?php dynField(@$country,'IL','option'); ?>>Israel</option>
 <option value="IT"<?php dynField(@$country,'IT','option'); ?>>Italy</option>
 <option value="JM"<?php dynField(@$country,'JM','option'); ?>>Jamaica</option>
 <option value="JP"<?php dynField(@$country,'JP','option'); ?>>Japan</option>
 <option value="JO"<?php dynField(@$country,'JO','option'); ?>>Jordan</option>
 <option value="KZ"<?php dynField(@$country,'KZ','option'); ?>>Kazakhstan</option>
 <option value="KE"<?php dynField(@$country,'KE','option'); ?>>Kenya</option>
 <option value="KI"<?php dynField(@$country,'KI','option'); ?>>Kiribati</option>
 <option value="KP"<?php dynField(@$country,'KP','option'); ?>>Korea, Democratic People's Republic of</option>
 <option value="KR"<?php dynField(@$country,'KR','option'); ?>>Korea, Republic of</option>
 <option value="KW"<?php dynField(@$country,'KW','option'); ?>>Kuwait</option>
 <option value="KG"<?php dynField(@$country,'KG','option'); ?>>Kyrgyzstan</option>
 <option value="LA"<?php dynField(@$country,'LA','option'); ?>>Lao People's Democratic Republic</option>
 <option value="LV"<?php dynField(@$country,'LV','option'); ?>>Latvia</option>
 <option value="LB"<?php dynField(@$country,'LB','option'); ?>>Lebanon</option>
 <option value="LS"<?php dynField(@$country,'LS','option'); ?>>Lesotho</option>
 <option value="LR"<?php dynField(@$country,'LR','option'); ?>>Liberia</option>
 <option value="LY"<?php dynField(@$country,'LY','option'); ?>>Libyan Arab Jamahiriya</option>
 <option value="LI"<?php dynField(@$country,'LI','option'); ?>>Liechtenstein</option>
 <option value="LT"<?php dynField(@$country,'LT','option'); ?>>Lithuania</option>
 <option value="LU"<?php dynField(@$country,'LU','option'); ?>>Luxembourg</option>
 <option value="MO"<?php dynField(@$country,'MO','option'); ?>>Macau</option>
 <option value="MK"<?php dynField(@$country,'MK','option'); ?>>Macedonia, The Former Yugoslav Republic of</option>
 <option value="MG"<?php dynField(@$country,'MG','option'); ?>>Madagascar</option>
 <option value="MW"<?php dynField(@$country,'MW','option'); ?>>Malawi</option>
 <option value="MY"<?php dynField(@$country,'MY','option'); ?>>Malaysia</option>
 <option value="MV"<?php dynField(@$country,'MV','option'); ?>>Maldives</option>
 <option value="ML"<?php dynField(@$country,'ML','option'); ?>>Mali</option>
 <option value="MT"<?php dynField(@$country,'MT','option'); ?>>Malta</option>
 <option value="MH"<?php dynField(@$country,'MH','option'); ?>>Marshall Islands</option>
 <option value="MQ"<?php dynField(@$country,'MQ','option'); ?>>Martinique</option>
 <option value="MR"<?php dynField(@$country,'MR','option'); ?>>Mauritania</option>
 <option value="MU"<?php dynField(@$country,'MU','option'); ?>>Mauritius</option>
 <option value="YT"<?php dynField(@$country,'YT','option'); ?>>Mayotte</option>
 <option value="MX"<?php dynField(@$country,'MX','option'); ?>>Mexico</option>
 <option value="FM"<?php dynField(@$country,'FM','option'); ?>>Micronesia, Federated States of</option>
 <option value="MD"<?php dynField(@$country,'MD','option'); ?>>Moldova, Republic of</option>
 <option value="MC"<?php dynField(@$country,'MC','option'); ?>>Monaco</option>
 <option value="MN"<?php dynField(@$country,'MN','option'); ?>>Mongolia</option>
 <option value="MS"<?php dynField(@$country,'MS','option'); ?>>Montserrat</option>
 <option value="MA"<?php dynField(@$country,'MA','option'); ?>>Morocco</option>
 <option value="MZ"<?php dynField(@$country,'MZ','option'); ?>>Mozambique</option>
 <option value="MM"<?php dynField(@$country,'MM','option'); ?>>Myanmar</option>
 <option value="NA"<?php dynField(@$country,'NA','option'); ?>>Namibia</option>
 <option value="NR"<?php dynField(@$country,'NR','option'); ?>>Nauru</option>
 <option value="NP"<?php dynField(@$country,'NP','option'); ?>>Nepal</option>
 <option value="NL"<?php dynField(@$country,'NL','option'); ?>>Netherlands</option>
 <option value="AN"<?php dynField(@$country,'AN','option'); ?>>Netherlands Antilles</option>
 <option value="NC"<?php dynField(@$country,'NC','option'); ?>>New Caledonia</option>
 <option value="NZ"<?php dynField(@$country,'NZ','option'); ?>>New Zealand</option>
 <option value="NI"<?php dynField(@$country,'NI','option'); ?>>Nicaragua</option>
 <option value="NE"<?php dynField(@$country,'NE','option'); ?>>Niger</option>
 <option value="NG"<?php dynField(@$country,'NG','option'); ?>>Nigeria</option>
 <option value="NU"<?php dynField(@$country,'NU','option'); ?>>Niue</option>
 <option value="NF"<?php dynField(@$country,'NF','option'); ?>>Norfolk Island</option>
 <option value="MP"<?php dynField(@$country,'MP','option'); ?>>Northern Mariana Islands</option>
 <option value="NO"<?php dynField(@$country,'NO','option'); ?>>Norway</option>
 <option value="OM"<?php dynField(@$country,'OM','option'); ?>>Oman</option>
 <option value="PK"<?php dynField(@$country,'PK','option'); ?>>Pakistan</option>
 <option value="PW"<?php dynField(@$country,'PW','option'); ?>>Palau</option>
 <option value="PA"<?php dynField(@$country,'PA','option'); ?>>Panama</option>
 <option value="PG"<?php dynField(@$country,'PG','option'); ?>>Papua New Guinea</option>
 <option value="PY"<?php dynField(@$country,'PY','option'); ?>>Paraguay</option>
 <option value="PE"<?php dynField(@$country,'PE','option'); ?>>Peru</option>
 <option value="PH"<?php dynField(@$country,'PH','option'); ?>>Philippines</option>
 <option value="PN"<?php dynField(@$country,'PN','option'); ?>>Pitcairn</option>
 <option value="PL"<?php dynField(@$country,'PL','option'); ?>>Poland</option>
 <option value="PT"<?php dynField(@$country,'PT','option'); ?>>Portugal</option>
 <option value="PR"<?php dynField(@$country,'PR','option'); ?>>Puerto Rico</option>
 <option value="QA"<?php dynField(@$country,'QA','option'); ?>>Qatar</option>
 <option value="RE"<?php dynField(@$country,'RE','option'); ?>>Reunion</option>
 <option value="RO"<?php dynField(@$country,'RO','option'); ?>>Romania</option>
 <option value="RU"<?php dynField(@$country,'RU','option'); ?>>Russian Federation</option>
 <option value="RW"<?php dynField(@$country,'RW','option'); ?>>Rwanda</option>
 <option value="KN"<?php dynField(@$country,'KN','option'); ?>>Saint Kitts and Nevis</option>
 <option value="LC"<?php dynField(@$country,'LC','option'); ?>>Saint LUCIA</option>
 <option value="VC"<?php dynField(@$country,'VC','option'); ?>>Saint Vincent and the Grenadines</option>
 <option value="WS"<?php dynField(@$country,'WS','option'); ?>>Samoa</option>
 <option value="SM"<?php dynField(@$country,'SM','option'); ?>>San Marino</option>
 <option value="ST"<?php dynField(@$country,'ST','option'); ?>>Sao Tome and Principe</option>
 <option value="SA"<?php dynField(@$country,'SA','option'); ?>>Saudi Arabia</option>
 <option value="SN"<?php dynField(@$country,'SN','option'); ?>>Senegal</option>
 <option value="SC"<?php dynField(@$country,'SC','option'); ?>>Seychelles</option>
 <option value="SL"<?php dynField(@$country,'SL','option'); ?>>Sierra Leone</option>
 <option value="SG"<?php dynField(@$country,'SG','option'); ?>>Singapore</option>
 <option value="SK"<?php dynField(@$country,'SK','option'); ?>>Slovakia (Slovak Republic)</option>
 <option value="SI"<?php dynField(@$country,'SI','option'); ?>>Slovenia</option>
 <option value="SB"<?php dynField(@$country,'SB','option'); ?>>Solomon Islands</option>
 <option value="SO"<?php dynField(@$country,'SO','option'); ?>>Somalia</option>
 <option value="ZA"<?php dynField(@$country,'ZA','option'); ?>>South Africa</option>
 <option value="GS"<?php dynField(@$country,'GS','option'); ?>>South Georgia and the South Sandwich Islands</option>
 <option value="ES"<?php dynField(@$country,'ES','option'); ?>>Spain</option>
 <option value="LK"<?php dynField(@$country,'LK','option'); ?>>Sri Lanka</option>
 <option value="SH"<?php dynField(@$country,'SH','option'); ?>>St. Helena</option>
 <option value="PM"<?php dynField(@$country,'PM','option'); ?>>St. Pierre and Miquelon</option>
 <option value="SD"<?php dynField(@$country,'SD','option'); ?>>Sudan</option>
 <option value="SR"<?php dynField(@$country,'SR','option'); ?>>Suriname</option>
 <option value="SJ"<?php dynField(@$country,'SJ','option'); ?>>Svalbard and Jan Mayen Islands</option>
 <option value="SZ"<?php dynField(@$country,'SZ','option'); ?>>Swaziland</option>
 <option value="SE"<?php dynField(@$country,'SE','option'); ?>>Sweden</option>
 <option value="CH"<?php dynField(@$country,'CH','option'); ?>>Switzerland</option>
 <option value="SY"<?php dynField(@$country,'SY','option'); ?>>Syrian Arab Republic</option>
 <option value="TW"<?php dynField(@$country,'TW','option'); ?>>Taiwan, Province of China</option>
 <option value="TJ"<?php dynField(@$country,'TJ','option'); ?>>Tajikistan</option>
 <option value="TZ"<?php dynField(@$country,'TZ','option'); ?>>Tanzania, United Republic of</option>
 <option value="TH"<?php dynField(@$country,'TH','option'); ?>>Thailand</option>
 <option value="TG"<?php dynField(@$country,'TG','option'); ?>>Togo</option>
 <option value="TK"<?php dynField(@$country,'TK','option'); ?>>Tokelau</option>
 <option value="TO"<?php dynField(@$country,'TO','option'); ?>>Tonga</option>
 <option value="TT"<?php dynField(@$country,'TT','option'); ?>>Trinidad and Tobago</option>
 <option value="TN"<?php dynField(@$country,'TN','option'); ?>>Tunisia</option>
 <option value="TR"<?php dynField(@$country,'TR','option'); ?>>Turkey</option>
 <option value="TM"<?php dynField(@$country,'TM','option'); ?>>Turkmenistan</option>
 <option value="TC"<?php dynField(@$country,'TC','option'); ?>>Turks and Caicos Islands</option>
 <option value="TV"<?php dynField(@$country,'TV','option'); ?>>Tuvalu</option>
 <option value="UG"<?php dynField(@$country,'UG','option'); ?>>Uganda</option>
 <option value="UA"<?php dynField(@$country,'UA','option'); ?>>Ukraine</option>
 <option value="AE"<?php dynField(@$country,'AE','option'); ?>>United Arab Emirates</option>
 <option value="GB"<?php dynField(@$country,'GB','option'); ?>>United Kingdom</option>
 <option value="US"<?php dynField(@$country,'US','option'); ?>>United States</option>
 <option value="UM"<?php dynField(@$country,'UM','option'); ?>>United States Minor Outlying Islands</option>
 <option value="UY"<?php dynField(@$country,'UY','option'); ?>>Uruguay</option>
 <option value="UZ"<?php dynField(@$country,'UZ','option'); ?>>Uzbekistan</option>
 <option value="VU"<?php dynField(@$country,'VU','option'); ?>>Vanuatu</option>
 <option value="VE"<?php dynField(@$country,'VE','option'); ?>>Venezuela</option>
 <option value="VN"<?php dynField(@$country,'VN','option'); ?>>Viet Nam</option>
 <option value="VG"<?php dynField(@$country,'VG','option'); ?>>Virgin Islands (British)</option>
 <option value="VI"<?php dynField(@$country,'VI','option'); ?>>Virgin Islands (U.S.)</option>
 <option value="WF"<?php dynField(@$country,'WF','option'); ?>>Wallis and Futuna Islands</option>
 <option value="EH"<?php dynField(@$country,'EH','option'); ?>>Western Sahara</option>
 <option value="YE"<?php dynField(@$country,'YE','option'); ?>>Yemen</option>
 <option value="YU"<?php dynField(@$country,'YU','option'); ?>>Yugoslavia</option>
 <option value="ZM"<?php dynField(@$country,'ZM','option'); ?>>Zambia</option>
 <option value="ZW"<?php dynField(@$country,'ZW','option'); ?>>Zimbabwe</option>
</select>

Google Maps Static Images, How to Create

March 30th, 2010

Creating Google maps images to display on your website are really neat. They load really fast and can really give visitors a good idea of where something is located. I personally like to use them on contact us pages to show the location of a company.

Creating them is a blast and relatively easy. First you will need to know the location of the company or whatever your looking to create a map for. Next have an idea of what type of dimensions you want the map to be and finally if you want markers on it you will need to know the latitude and longitude of the spot the market should go.

After you’ve compiled all that data together now is the easy part, just replace your data with what is in the below URL.

http://maps.google.com/staticmap?size=300x115&center=mars+pa&zoom=13&markers=40.6958996,-80.0117254
&key=YOUR_KEY_HERE

This gives you:

You will also notice there is a zoom reference in the URL above. With that you can set how close or far out the zoom level is for the screen shot of the map.

If you are clueless and scratching your head when you look at this URL and don’t get how to put the data in, here are some helpful hints. Directly after each & symbol in the URL is what is called a parameter. This basically is a “label” that you can define. For example in URL above you will see “size” this is a parameter that we can set, simple add your dimensions after the equals sign (make sure you keep the same format).

So now you have a basic understanding of the syntax of the URL you might be wondering what the parameter “center” is for… well that’s the address for the company or place you want a map of. And of course “marker” is the latitude and longitude of where the marker should fall on the map. Also make sure to replace the YOUR_KEY_HERE with the key get from signing up with Google Maps API.

Lastly take the URL and put it into an image’s source tag as follows:

<img src="http://maps.google.com/staticmap?size=300x115&center=mars+pa&zoom=13&markers=40.6958996,
-80.0117254&key=YOUR_KEY_HERE" alt=""/>

I’ve also found a good reference for creating these maps really quickly if you’re still having trouble, can’t calculate the lat and long for the market, or just want something faster/easier then try Google Static Map Wizard.

Follow this author on Google+