WordPress.org

Ready to get started?Download WordPress

Forums

Guitar Tuner web site code (4 posts)

  1. Brad Reddekopp
    Member
    Posted 1 year ago #

    I really like the online guitar tuner at http://www.gieson.com/Library/projects/utilities/tuner/ and he offers code and a swf file for those who'd like to add it to their own web sites. However, I lack the skills to figure out how to adapt that code so that it'll work in a WordPress page.

    Here's the code:

    <!-- START GUITAR TUNER CODE
    Guitar Tuner - Copyright (c) 2002 Mike Gieson. If you use the guitar tuner on your web site, please provide a link back to me using the following as an example: Guitar Tuner courtesy of the folks at <a href="http://www.wimpyplayer.com">Wimpy Player</a>
    -->
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="600" height="288">
    <param name=movie value="tuner24.swf">
    <param name=quality value=high>
    <embed src="tuner24.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="600" height="288">
    </embed> </object>
    <p>Guitar Tuner courtesy of the folks at <a href="http://www.wimpyplayer.com">Wimpy Player</a></p>
    <!-- END GUITAR TUNER CODE -->

    Any ideas? Is this do-able without excessive effort?

  2. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 1 year ago #

    One way is to create a simple shortcode plugin.

    Here's a step-by step method (not fully tested, but seems to work OK for me)

    1. Download the package on the right-hand sidebar of the link you gave & extract the zip to your desktop
    2. Use your ftp app to connect to your wp-content/plugins directory
    3. Create a new folder within your plugins directory called 'embed-wimpyplayer-guitartuner'
    4. upload the tuner24.swf from the extracted zip to the new folder
    5. create a new text file in the folder called guitar-tuner.php & copy in the code below
    6. <?php
      /*
      Plugin Name: Embed Wimpyplayer Guitar Tuner
      Description: Embeds guitar tuner from http://www.wimpyplayer.com using [guitartuner] shortcode
      Author: cubecolour
      Version: 0.1 beta
      Author URI: http://cubecolour.co.uk/
      Last Edit: 31st December 2012
      */
      
      function cc_guitartuner( $atts, $content = null ) {
      
      return '<!-- START GUITAR TUNER CODE
      Guitar Tuner - Copyright (c) 2002 Mike Gieson. If you use the guitar tuner on your web site, please provide a link back to me using the following as an example: Guitar Tuner courtesy of the folks at <a href="http://www.wimpyplayer.com">Wimpy Player</a>
      -->
      
      <object id="flashcontent"
              classid="classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
              width="600px"
              height="228px">
        <param name="movie" value="' . plugins_url() . '/embed-wimpyplayer-guitartuner/tuner24.swf" />
      
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash"
                data="' . plugins_url() . '/embed-wimpyplayer-guitartuner/tuner24.swf"
                width="600px"
                height="228px">
        <!--<![endif]-->
      
          <p>
            Oops! The SWF failed to load.
          </p>
      
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
      
      </object>
      
      <p>Guitar Tuner courtesy of the folks at <a href="http://www.wimpyplayer.com">Wimpy Player</a></p>
      <!-- END GUITAR TUNER CODE -->';
      }
      
      add_shortcode('guitartuner', 'cc_guitartuner');
    7. In WordPress admin -> plugins activate the new 'Embed Wimpyplayer Guitar Tuner' plugin
    8. add a [guitartuner] shortcode to your post or page where you want the tuner to appear
  3. Brad Reddekopp
    Member
    Posted 1 year ago #

    That works perfectly. Thank you!

    http://www.axesofego.com/?page_id=687

  4. Brad Reddekopp
    Member
    Posted 1 year ago #

    I added an acknowledgement link to my page. Thanks again, cubecolour.

Topic Closed

This topic has been closed to new replies.

About this Topic