Hallo,
ich stehe echt auf dem Schlauch ...
Ich wollte einen ganz einfachen Test machen, um über php und jquery Daten aus der MySql Datenbank zu holen.
Leider geht das innerhalb meines Wordpressthemes (responsive) nicht, d.h. es passiert einfach gar nichts.
Mit einem ganz einfachen Seitenaufbau (ohne das Wordpresstheme) funktioniert es problemlos.
Kann mir vielleicht jemand helfen und sagen, wo der Fehler liegt?
Meine Seite:
PHP
<?php
// Exit if accessed directly
if ( !defined('ABSPATH')) exit;
/**
* Full Content Template
*
Template Name: nochEinTest
*
* @file nochEinTest.php
* @package Responsive
* @author Emil Uzelac
* @copyright 2003 - 2011 ThemeID
* @license license.txt
* @version Release: 1.0
* @filesource wp-content/themes/responsive/nochEinTest.php
* @link http://codex.wordpress.org/Theme_Development#Pages_.28page.php.29
* @since available since Release 1.0
*/
get_header(); ?>
<div id="content-full" class="grid col-940">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part( 'loop-header' ); ?>
<div>
Category: <input type="text" id="category">
<input type="submit" id="category-submit" value="Search">
<div id="category-data"></div>
</div>
<?php
endwhile;
get_template_part( 'loop-nav' );
else :
get_template_part( 'loop-no-posts' );
endif;
?>
</div><!-- end of #content-full -->
<?php get_footer(); ?>
Alles anzeigen
Ausschnitt aus header.php
PHP
<?php
// Exit if accessed directly
if ( !defined('ABSPATH')) exit;
/**
* Header Template
*
*
* @file header.php
* @package Responsive
* @author Emil Uzelac
* @copyright 2003 - 2013 ThemeID
* @license license.txt
* @version Release: 1.3
* @filesource wp-content/themes/responsive/header.php
* @link http://codex.wordpress.org/Theme_Development#Document_Head_.28header.php.29
* @since available since Release 1.0
*/
?>
<!doctype html>
<!--[if !IE]> <html class="no-js non-ie" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 7 ]> <html class="no-js ie7" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 8 ]> <html class="no-js ie8" <?php language_attributes(); ?>> <![endif]-->
<!--[if IE 9 ]> <html class="no-js ie9" <?php language_attributes(); ?>> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js" <?php language_attributes(); ?>> <!--<![endif]-->
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
<title><?php wp_title('|', true, 'right'); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php wp_enqueue_style('responsive-style', get_stylesheet_uri(), false, '1.9.3.1');?>
<?php wp_enqueue_script('jquery'); ?>
<?php wp_head(); ?>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="global.js"></script>
</head>
.....
.....
Alles anzeigen
global.js
Code
$(document).ready(function(){
alert("eins");
});
$('input#category-submit').on('click', function() {
alert(1);
});
Die global.js liegt auf der selben Verzeichnisebene wie header.php und nochEinTest.php
Würde mich sehr über Eure Hilfe freuen!!!
DANKE!!!