Monthly Archives: January 2015

Putting jQuery Into No-Conflict Mode

<!-- Putting jQuery into no-conflict mode. -->
<script src="prototype.js"></script>
<script src="jquery.js"></script>
<script>
var $myname = jQuery.noConflict();
// $myname is now an alias to the jQuery function; creating the new alias is optional.
$myname(document).ready(function() {
$myname( "div" ).hide();
});
/* The $ variable now has the prototype meaning, which is a shortcut for document.getElementById(). */
</script>

Change jquery function ($( document ).ready()) to anonymous function.

// Passing a named function instead of an anonymous function.
function myname( jQuery ) {
// Code to run when the document is ready.
}
$( document ).ready( myname);
// or:
$( window ).load( myname);

Live css and js files

jQuery min.js

http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js

save me

<?php
/**
Template Name: Fourm
*/
get_header();
?>

<div id=”primary” class=”content-area”>
<main class=”site-main”>

<script>
jQuery(function() {
jQuery(‘form#ff’).on(‘submit’, function(e) {
jQuery.ajax({
type: ‘post’,
url: ‘dashbord.php’,
data: jQuery(this).serialize(),
success: function(o) {

alert(‘MUST ALERT TO DETERMINE SUCCESS PAGE’);
}
});
e.preventDefault();
});
});
</script>
<form id=”ff” method=”post” action=””>
First name:<br>
<input type=”text” name=”firstname”>
<br>
Last name:<br>
<input type=”text” name=”lastname”>
<br>
Email:<br>
<input type=”text” name=”email”>
<br>
Compny name<br>
<input type=”text” name=”cname”>
<br>
Compny grade<br>
<input type=”text” name=”cgrade”>
<br>
<input type=”submit” name=”submit”>
<?php
if (isset($_POST[‘submit’])) {

$fname = $_POST[‘firstname’];
$lname = $_POST[‘lastname’];
$email = $_POST[’email’];
$cname = $_POST[‘cname’];
$cgrade = $_POST[‘cgrade’];

$wpdb->insert(
’employe’, array(
‘fname’ => $fname,
‘lname’ => $lname,
’email’ => $email
));
$wpdb->insert(
‘compny’, array(
‘compnyname’ => $cname,
‘compnygrade’ => $cgrade
)
);
}
?>
</form>

<?php
$result = $wpdb->get_results(“SELECT * FROM employe”);
echo ‘<table>’;
foreach ($result as $print) {
echo ‘<tr>’;
echo ‘<td>’ . $print->fname . ‘</td>’;
echo ‘<td>’ . $print->lname . ‘</td>’;
echo ‘<td>’ . $print->email . ‘</td>’;
//echo ‘<td>’.$print->compnyname.'</td>’;
//echo ‘<td>’.$print->compnygrade.'</td>’;
echo ‘<tr>’;
}
echo ‘</table>’;
?>

<script type=’text/javascript’>

</script>

<?php //include_once(‘dashbord.php’); ?>
</main><!– .site-main –>
</div><!– .content-area –>

<?php get_footer(); ?>

archive.php

/**
* Archive Page template file
* */

/* date function for displaying archive by day, month and year */

if (is_day()) :
_e(‘Daily Archives’, ‘advent’);
echo ” : ” . get_the_date();
elseif (is_month()) :
_e(‘Monthly Archives’, ‘advent’);
echo ” : ” . get_the_date(‘F Y’);
elseif (is_year()) :
_e(‘Yearly Archives’, ‘advent’);
echo ” : ” . get_the_date(‘Y’);
else :
_e(‘Archives’, ‘advent’);

endif;

404.php

below commented code is required for understanding which name of this template file.
/**
* 404 page template file
* */

/* if advent_custom_breadcrumbs() is exists in function.php then */ 

if (function_exists(‘advent_custom_breadcrumbs’)) advent_custom_breadcrumbs();

  /* search form function */

get_search_form();

Plugins for theme development check

1)  Monster Widget
2) Theme Check
3) Debug Bar
5) Query Monitor
4) Import data 
    => Tools => Import =>

%d bloggers like this: