Monthly Archives: April 2012

Calculate Weights On Planets

Weight Calculation for Planets

Enter the weight on Earth and click ‘Calculate Weights’:

Earth:
 
Mercury:
Venus:
Moon:
Mars:
Jupiter:
Saturn:
Uranus:
Neptune:
Pluto:
 

 

Form To Calculate Weights On Planets

This article shows the details of a form that calculates the weight on different planets given the weight on earth. It illustrates the following:

  • Coding the form in the HTML mode of the WP editor
  • Using a shortcode to insert the JavaScript that does the calculations
  • The JavaScript itself

Click here to try it out!

Here is a screenshot of the output:

Calculate Planetary Weights screenshot
Continue reading

Select Posts On The First Letter Of A Custom Field

This post is in response to a request to filter posts based on the first letter of a custom field. The requestor was creating a staff listing where the person’s last name was stored in a custom field named ‘staff_last_name’. A menu of all letters was needed to allow the viewer to select the letter to view.

The code shown below should be added into a template that is customized for the theme in use. Continue reading