Hi , ich hab eein fertiges tool welches auch ohne wordpress funktioniert. ich würde gerne daraus ein Plugin machen.
http://www.getamobile.at/personaltool/
es besteht aus html und Java Script.
das html wird ausgegeben allerdings nutzt er kein javascript oder css datei.
PS: Das ist mein erstes Plugin was ich erstelle. hab mir das hallo welt plugin sowie selbst ein kleines php lugin gemacht was auch funktioniert.
ich habe es mal so versucht :
/**/
function wptuts_scripts_with_jquery()
{
// Register the script like this for a plugin:
wp_register_script( 'custom-script', plugins_url( 'tool.js', __FILE__ ), array( 'jquery' ) );
wp_enqueue_script( 'custom-script' );
wp_register_script( 'custom-script2', plugins_url( '/js/jquery.jqplot.js.js', __FILE__ ), array( 'jquery' ) );
wp_enqueue_script( 'custom-script2' );
wp_register_script( 'custom-script3', plugins_url( '/js/jquery-ui-1.10.3.custom.min.js', __FILE__ ), array( 'jquery' ) );
wp_enqueue_script( 'custom-script3' );
}
add_action( 'wp_enqueue_scripts', 'wptuts_scripts_with_jquery' );
/**
* Register with hook 'wp_enqueue_scripts', which can be used for front end CSS and JavaScript
*/
add_action( 'wp_enqueue_scripts', 'prefix_add_my_stylesheet' );
function my_scripts() {
wp_enqueue_script( 'jquery' );
wp_register_style( 'prefix-style', plugins_url('template.css', __FILE__) );
wp_enqueue_style( 'prefix-style' );
}
add_action('wp_enqueue_scripts','my_scripts');
/*---------------------------------------------------------------------*/
/**/
/
function personaltool_shortcode($atts)
{
echo'
<!-- <form> -->
<div id="accordion">
<h3>Branche/Bundesland</h3>
<div id="acc1"> <!-- Akkordion Fläche 1 -->
<!--<p class="form_p"> Schritt 1 von 5:</p>-->
<p class="form-h3">Bitte geben Sie an, zu welcher Branche das Unternehmen zählt: </p>
<p> Branche: </p>
<select name="Branche" id="Branche">
<option value="Automobilindustrie">Automobilindustrie</option>
<option value="Versicherungen">Versicherungen</option>
<option value="Banken" selected>Banken</option>
<option value="Handwerk">Handwerk</option>
</select>
<p class="form-h3"> Bitte geben Sie an, in welchem Bundesland das Unternehmen ansässig ist: </p>
der HTML code ist ca 500 zeilen lang
....
</div>
<!-- acc6 -->
</div> <!-- Accordion Ende -->
<!-- </form> -->
<br clear="all"/>
<input type="text" id="Debug"></input>
<div id="diagramm1" style="height:400px;width:650px"></div>
<div id="ergebnisse" style="height:400px;width:650px"></div>
<br>
<div id="Ergebnisbereich"></div>
';
}
/*shortcode*/
add_shortcode('pt', 'personaltool_shortcode');