Monday, 27 January 2014

PHP

How to create login and registration page 

Connect.php
 <?php
$conn = mysqli_connect("localhost", "root", "","login");

/*if($conn) {
echo "connect successfully";
}
else {
echo "not connected";
}*/

//$db = mysql_select_db("login");

/*if($db) {
echo "db connect successfully";
}
else {
echo "db not connected";
}*/
?>

Register.php 
<?php include('connect.php'); ?>
<?php
if(isset($_POST['psw'])){
$email = $_POST['email'];
$pass = md5($_POST['psw']);
$repeat_pass = md5($_POST['psw-repeat']);
if($pass == $repeat_pass ) {
$sql ="insert into user (username, password) values ('$email','$pass')";
mysqli_query($conn,$sql);
}
else {
echo "password did not match";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
/* Full-width input fields */
input[type=text], input[type=password] {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

/* Set a style for all buttons */
button {
    background-color: #4CAF50;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
    width: 100%;
}

/* Extra styles for the cancel button */
.cancelbtn {
    padding: 14px 20px;
    background-color: #f44336;
}

/* Float cancel and signup buttons and add an equal width */
.cancelbtn,.signupbtn {
    float: left;
    width: 50%;
}

/* Add padding to container elements */
.container {
    padding: 16px;
}

/* Clear floats */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Change styles for cancel button and signup button on extra small screens */
@media screen and (max-width: 300px) {
    .cancelbtn, .signupbtn {
        width: 100%;
    }
}
</style>

</head>

<body>
    <form action="#" method="post" enctype="multipart/form-data">
  <div class="container">
    <label><b>Email</b></label>
    <input type="text" placeholder="Enter Email" name="email" >

    <label><b>Password</b></label>
    <input type="password" placeholder="Enter Password" name="psw" >

    <label><b>Repeat Password</b></label>
    <input type="password" placeholder="Repeat Password" name="psw-repeat" >
  

    <div class="clearfix">
      <button type="button"  class="cancelbtn">Cancel</button>
      <button type="submit" name="subbuton" class="signupbtn">Sign Up</button>
    </div>
  </div>
</form>
   
</body>
</html>



Login.php

 <!DOCTYPE HTML>
<?php include('connect.php'); ?>
<?php
if(isset($_POST['user'])){
$username = $_POST['user'];
$password = $_POST['pass'];
$sql="select * from user where username='".$username."' and password='".md5($password)."'";
$result=mysqli_query($conn,$sql);
$count=mysqli_num_rows($result);
if ($count>0){
echo "welcome user";
}
else {
echo "user name and password is wrong";
}
}
?>
<html>
<head>
<title>Sign-In</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body id="body-color">
<div id="Sign-In">
<fieldset style="width:30%"><legend>LOG-IN HERE</legend>
<form method="post" action="#">
User <br><input type="text" name="user" size="40"><br>
Password <br><input type="password" name="pass" size="40"><br>
<input id="button" type="submit" name="submit" value="Log-In">
</form>
</fieldset>
</div>
</body>
</html>
===============End===============================================

connection & select query
=============================
<?php
  $conn = mysql_connect("localhost","root","");
    mysql_select_db("neuralin_EMS");

if($conn) {
echo "connect successfully";
}

else {
 echo "Could not connect:". mysql_error();
}
$sql= "select * from projectmaster";

$query = mysql_query($sql);

while ($result= mysql_fetch_array($query)){
 echo $result['projectName'].'<br>'. $result['ProjectID'].'<br>';
    }

?>


*****************************************
call dynamic TITLE & HEADING
*****************************************
save in configuration.php & call(include) in any page as <?php include("configuration.php"); ?>
Show title-<?php echo TITLE; ?>
---------------------------------------------------------------------------

<?php
define("TITLE","HOME | ENQUIRY MANAGEMENT SYSTEM");
define("PROJECTNAME","Enquiry Management System");
?>

*************************************************************
INCLUDE ONLY ONE TIME
***************************************************************
<?php include_once"menu/menu.html";?>
***********************************************************************
SQL CONNECTION
**************************************************************
db.php
------------------------------------------------------------------------
<?php
$sql = mysql_connect('localhost','root','') or die('connection failed');
mysql_select_db('enquiry',$sql) or die('db not select');
?
*********************************************************
INDEX.PHP
*********************************************************
<?php include("configuration.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>
<div class="wrapper" align="center">
<div class="header" align="center">
   <div class="logo"><img width="150px;" src="../../lalit/cms/wordpress/hitechcomputer/Untitled-1.png" alt="wrong image"/></div>

       <div class="clear"></div>
        <div class="menu"><?php echo PROJECTNAME; ?></div>
         </div>
         <div class="main">
       
         <div class="right" style=" margin: 65px; width: 500px; float:left"></div>
       
         <div class="left" style="border: 0px solid #fff; margin: 65px; height: 250px; width: 500px; float:left">
         <form name="frm" method="post" action="check.php">
         <h1> Login </h1>
         <ul>
         <label>User Name:</label>
         <label><input type="text" name="userName" placeholder="Enter Your Name!" required="required"/></label>
         </ul>
          <ul>
         <label>Password:</label>
         <label><input type="password" name="password" placeholder="Enter Your Password!" required="required"/ /></label>
         </ul>
         <ul>
         <label><input type="submit" name="login" value="Login" /></label></ul>
         </form>
         <?php if($_GET['error']==1) { echo '<font color="#FF0000">Error</font>'; } ?>
         </div>

         </div>
 
         <div class="footer" style="">Created By LALIT TIWARI.</div>
 
</div>


</body>
</html>
-----------------------------------------------------------------------
add(insert).php
---------------------------------------------------------------------------
<?php
include('db.php');
if(isset($_POST['add'])){
$name = $_POST['nm'];
$Phone = $_POST['phn'];
$Address = $_POST['address'];
$Purpose = $_POST['pur'];
$Email = $_POST['eml'];
$In = $_POST['intm'];
$Out = $_POST['outm'];
$insert = "insert into system (Name,Phoneno,Address,Purpose,Email,InTime,OutTime) values ('$name','$Phone','$Address','$Purpose','$Email','$In','$Out')";
mysql_query($insert);
//ADD VALUE & BACK TO HOME PAGE
------------------------------------------------------
//header('location: newdashboard.php');
?>            OR
<script type="text/javascript" language="javascript">
window.location="newdashboard.php";
</script>
<?php
}
?>
****************************************************
INSERTED VALUES :SELECT IN DB QUERY
------------------------------------------------------
<table>
<div class="add"><a href="add.php">Add</a></div>
<thead>
 <tr>
 <th>Id:</th>
<th>Name:</th>
<th>Phone no:</th>
 <th>Address:</th>
<th>Purpose:</th>
<th>Email:</th>
<th>In Time:</th>
<th>Out Time:</th>
<th>Actions:</th>
</tr>
 </thead>
<tbody>
 <?php
 $sql = "select * from system";
 $query =mysql_query($sql);
 while($result = mysql_fetch_array($query)){
?><tr>
    <td><?php echo $result['Id']; ?></td>
    <td><?php echo $result['Name']; ?></td>
    <td><?= $result['Phoneno']; ?></td>
    <td><?= $result['Address']; ?></td>
    <td><?php echo $result['Purpose']; ?></td>
    <td><?php echo $result['Email']; ?></td>
    <td><?= $result['InTime']; ?></td>
    <td><?= $result['OutTime']; ?></td>
    <td><a href="update.php?id=<?php echo $result['Id']; ?>">Update</a>&nbsp;|&nbsp;<a href="delete.php?id=<?php echo $result['Id']; ?>">Delete</a></td>
    </tr>
 
    <?php }
?>
</tbody>
 </table>
****************************************************
UPDATE.PHP
****************************************************
<?php
include('db.php');

$select = "select * from system where Id='".$_REQUEST['id']."'";
$query= mysql_query($select);

 $result = mysql_fetch_array($query);




if(isset($_POST['update'])){
$name = $_POST['nm'];
$Phone = $_POST['phn'];
$Address = $_POST['address'];
$Purpose = $_POST['pur'];
$Email = $_POST['eml'];
$In = $_POST['intm'];
$Out = $_POST['outm'];
$insert = "update system set Name='".$_REQUEST['nm']."', Phoneno='".$_REQUEST['phn']."', Address='".$_REQUEST['address']."', Purpose='".$_REQUEST['pur']."', Email='".$_REQUEST['eml']."', InTime='".$_REQUEST['intm']."', OutTime='".$_REQUEST['outm']."' where Id='".$_REQUEST['id']."'";
mysql_query($insert);

//header('location: newdashboard.php');
?>

<script type="text/javascript" language="javascript">
window.location='newdashboard.php';
</script>

<?php
}
?>
<form name="frm" method="post">
<table align="center" width="500px;" border="2px solid black;">
<tr>
<td>Name:</td>
<td><input type="text" name="nm" value="<?php echo $result['Name']; ?>" /></td>
</tr>

<tr>
<td>Phone no:</td>
<td><input type="text" name="phn" value="<?php echo $result['Phoneno']; ?>" /></td>
</tr>

<tr>
<td>Address:</td>
<td><input type="text" name="address" value="<?php echo $result['Address']; ?>" /></td>
</tr>
<tr>
<td>Purpose:</td>
<td><input type="text" name="pur" value="<?php echo $result['Purpose']; ?>" /></td>
</tr>


<tr>
<td>Email</td>
<td><input type="text" name="eml" value="<?php echo $result['Email']; ?>" /></td>
</tr>
<tr>
<td>In Time:</td>
<td><input type="text" name="intm" value="<?php echo $result['InTime']; ?>" /></td>
</tr>
<tr>
<td>Out Time:</td>
<td><input type="text" name="outm" value="<?php echo $result['OutTime']; ?>" /></td>
</tr>
<tr>
<td><input type="submit" name="update" value="update" /></td>
</tr>

</table>
</form>
******************************************************
DELETE.PHP
****************************************************
<?php
include('db.php');
$sql = "delete from system where Id='".$_REQUEST['id']."'";
mysql_query($sql);
//header('location: list.php');

?>

<script type="text/javascript" language="javascript">
window.location='newdashboard.php';
</script>
**************************************************
LOGOUT.PHP
*******************************************************
<?php 

ob_start();

session_start();

session_destroy();

header("location: index.php");

?>
**************************************************
CHECK.PHP
**************************************************
<?php
include("db.php");

if(isset($_POST['login']))
{
$userName = $_POST['userName'];
$password = $_POST['password'];

//echo $userName.'&nbsp;|&nbsp;'.$password.'<br>';

$sql = "select * from admin where status=1";
$query = mysql_query($sql);
while($result=mysql_fetch_array($query))
{
$usernameD = $result['username'];
$passwordD = $result['password'];

//echo $usernameD.'&nbsp;|&nbsp;'.$passwordD.'<br>';

if($userName==$usernameD && $password==$passwordD)
{

$_SESSION['userNameS']=$result['username'];
?>
<script type="text/javascript" language="javascript">
window.location='newdashboard.php';
</script>
<?php
}
else 
{
?>
<script type="text/javascript" language="javascript">
window.location='index.php?error=1';
</script>
<?php
}
}
}
else
{
?>
<script type="text/javascript" language="javascript">
window.location='index.php?error=1';
</script>
<?php
}
?>
=====================================================================
How to change admin site title
===============================================================
go to config.php and change site title
===================================================================
CALL DYNAMIC IMAGE
==================================================================
<?php $img =  pageImage(5); ?>
          <?php if($img!="") { ?>
          <img alt=""  width="981" height="269" src="admin/pageImage/<?php echo $img; ?>"/>
          <?php } ?>
======================================================================
CALL MAP
======================================================================
<iframe width="980" height="320" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Central+Park,+New+York,+NY,+USA&amp;aq=0&amp;sll=14.093957,1.318359&amp;sspn=69.699334,135.263672&amp;vpsrc=6&amp;ie=UTF8&amp;hq=Central+Park,+New+York,+NY,+USA&amp;ll=40.778265,-73.96988&amp;spn=0.033797,0.06403&amp;t=m&amp;output=embed"></iframe>

==================================================================
CALL FACEBOOK LIKEBOX
==================================================================
<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FEcolAgroVenture&amp;width=180&amp;height=290&amp;colorscheme=light&amp;show_faces=true&amp;header=true&amp;stream=false&amp;show_border=true&amp;appId=698612683499956" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:184px; height:290px;" allowTransparency="true"></iframe>

======================================================================
CALL SIDEBAR MARQUEE NEWS
==================================================================
<p style="font-family: 'Scada', sans-serif; color:#034ea2; border-bottom:1px dashed #797b7d; padding-bottom:10px; margin:0px 0 0 12px; font-size:16px; text-transform: upercase;  width: 88%;">News</p>

        <marquee height="200px" width="183px" scrollamount="4" onmouseout="start()" onmouseover="stop()" direction="up">
<ul>
<li>Price Distribution on 16 Dec 2013</li>
<li>Offer anouncement on 16 Dec 2013</li>
<li>Sevices for Customers 15 Nov 2013</li>
<li>Offers for Temples on 17 Jun 2013</li>
<li>2% Tax Included on 12 sep 2013</li>
</ul>
</marquee>
=======================================================================
CALL SIDEBAR SERVICES 
=======================================================================
 <p style="font-family: 'Scada', sans-serif; color:#034ea2; border-bottom:1px dashed #797b7d; padding-bottom:10px; margin:7px 12px 0; font-size:16px; text-transform: upercase;  width: 88%;">Services</p>
        <ul>
   <li><a href="solidwastemgnt.php">Solid Waste</a></li>

        <li><a href="#">Waste Water</a>
            
            <ul style="width:274px;">
                        <li><a href="effluenttreatment.php">Treatment</a></li>
                        <li><a href="bio.php">Bio-Remediation </a></li>
                        <li><a href="refinery.php">Refinery Oily</a></li>
                        </ul>
                        </li>
                 <li><a href="cat2.php">Agro and Food </a></li>
                        <li><a href="foulOdourGreenGases.php">Foul Odour </a></li>
                        <li><a href="cat1.php">Mushroom Farming</a>
                        
                        <ul style="width:277px;">
                        <li><a href="quickcomposting.php">Composting </a></li>
                        <li><a href="quickcasing.php">Quick Casing </a></li>
                        </ul>
                        </li>
            <li><a href="agriculture.php">Agriculture</a></li>
            <li><a href="effluentTreatmentSolidWastePlant.php">Solid Waste Plant</a></li>
        </ul>
=======================================================================
USE THIS CODE WHEN YOU WANT THIS PAGE
====================================================================
<div class="left_sidebar">
<?php include('include/service.php'); ?>
</div>
===================================================
CALL PAGECONTENT DYNAMIC
==========================================
<?php echo pageContent(34) ;?>
================================================
CALL PAGE TITLE DYNAMIC
===================================================
<title><?php echo pageTitle('34'); ?> | EcolAgro Venture Pvt. Ltd.</title>
=================================================
<?php include("connect.php"); ?>
<?php include('include/header.php'); ?>
<?php include('include/footer.php'); ?>
**********************************************************************************
ENQUIRY.PHP
***********************************************************************************



Db.php
****************************************************************************
<?php
$sql = mysql_connect('localhost','root','') or die("connection failed");
mysql_select_db('query',$sql) or die("connection failed");

?>
**************************************************************************
insert.php
***************************
<?php include('db.php');
if(isset($_POST['add'])){
$name = $_POST['nm'];
$mobile = $_POST['mob'];
$email = $_POST['email'];
$insert = "insert into student (Name,Mobile,Email) values ('$name','$mobile','$email')";
$result = mysql_query($insert);
//echo "value submitted successfully";
header('location: list.php');
}
?>

<form name="frm" method="post">
<table align="center" width="500px" border="2px solid black">

<tr>
<td>Name:</td>
<td> <input type="text" name="nm" value=""/>
</td>
</tr>
<tr>
<td>Mobile:</td>
<td> <input type="text" name="mob" value=""/>
</td>
</tr>
<tr>
<td>Email:</td>
<td> <input type="text" name="email" value=""/>
</td>
</tr>
<tr>

<td> <input type="submit" name="add" value="submit"/>
</td>
</tr>
</table>
</form>
******************************************
select.php
***********************

<?php
include('db.php');

$select = "select * from student";
$result = mysql_query($select);
while( $results = mysql_fetch_array($result))
{ ?>
<tr>
<td><?php echo $results['Name']; ?></td></br>
    <td><?= $results['Mobile']; ?></td>
</tr>
<?php }

?>
*************************************************************
update.php
**************************************

<?php include('db.php');
$select = "select * from student where id='".$_REQUEST['id']."'";
$result = mysql_query($select);

 $results = mysql_fetch_array($result);


if(isset($_POST['update'])){
$name = $_POST['nm'];
$mobile = $_POST['mob'];
$email = $_POST['email'];
$sql = "update student set Name='".$_REQUEST['nm']."', Mobile='".$_REQUEST['mob']."', Email='".$_REQUEST['email']."' where id='".$_REQUEST['id']."'";

mysql_query($sql);
//echo "value submitted successfully";
//header('location: list.php');
?>

<script type="text/javascript" language="javascript">
window.location='list.php';
</script>

<?php }
?>

<form name="frm" method="post">
<table align="center" width="500px" border="2px solid black">

<tr>
<td>Name:</td>
<td> <input type="text" name="nm" value="<?= $results['Name']; ?>" />
</td>
</tr>
<tr>
<td>Mobile:</td>
<td> <input type="text" name="mob" value="<?= $results['Mobile']; ?>" />
</td>
</tr>
<tr>
<td>Email:</td>
<td> <input type="text" name="email" value="<?= $results['Email']; ?>" />
</td>
</tr>
<tr>

<td> <input type="submit" name="update" value="submit"/>
</td>
</tr>
</table>
</form>
**************************************************
view.php
***********************************

<?php include('db.php');
$select = "select * from student where id='".$_REQUEST['id']."'";
$result = mysql_query($select);

 $results = mysql_fetch_array($result);



?>


<table align="center" width="500px" border="2px solid black">

<tr>
<td>Name:</td>
<td> <?= $results['Name']; ?>
</td>
</tr>
<tr>
<td>Mobile:</td>
<td> <?= $results['Mobile']; ?>
</td>
</tr>
<tr>
<td>Email:</td>
<td> <?= $results['Email']; ?>
</td>
</tr>
<tr>
<td>
<a href="list.php">back</a>
</td>
</tr>
</table>
======================================================================
dbconnect.php
======================================================================
db.php
******************************************************************************
<?php
$sql = mysql_connect('localhost','root','') or die('connection failed');
mysql_select_db('lalit',$sql) or die('db not select');
?>
***********************************************************************************
list.php
***********************************************************************************
<?php include('db.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>


<table align="center" border="1px solid black;" width="500px">
<a href="add.php">Add New</a>

<tr>
<td>Id</td>

<td>Name</td>
<td>Email</td>
<td>Message</td>
<td>Actions</td>
</tr>
<?php
$sql = "select * from emp ";
$query = mysql_query($sql);
while($result = mysql_fetch_array($query)){
?><tr>
    <td><?php echo $result['id']; ?></td>
    <td><?php echo $result['name']; ?></td>
    <td><?= $result['email']; ?></td>
    <td><?= $result['message']; ?></td>
    <td><a href="update.php?id=<?php echo $result['id']; ?>">Update</a>&nbsp;|&nbsp;<a href="delete.php?id=<?php echo $result['id']; ?>">Delete</a>&nbsp;|&nbsp;<a href="view.php?id=<?php echo $result['id']; ?>">View</a></td>
    </tr>
 
    <?php }
?>
</table>

</body>
</html>
***********************************************************************************
insert(add).php
**********************************************************************************
<?php
include('db.php');
if(isset($_POST['add'])){
$name = $_POST['nm'];
$email = $_POST['eml'];
$message = $_POST['msg'];
$insert = "insert into emp (name,email,message) values ('$name','$email','$message')";
mysql_query($insert);

header('location: list.php');
}
?>
<form name="frm" method="post">
<table align="center" width="500px;" border="2px solid black;">
<tr>
<td>Name</td>
<td><input type="text" name="nm" value="" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="eml" value="" /></td>
</tr>
<tr>
<td>Message</td>
<td><input type="text" name="msg" value="" /></td>
</tr>
<tr>
<td><input type="submit" name="add" value="add" /></td>
</tr>

</table>
</form>
******************************************************************************
select.php
*******************************************************************************
<?php
$sql = "select * from emp";
$query = mysql_query($sql);
while($result = mysql_fetch_array($query)){
?><tr>
    <td><?php echo $result['nm']; ?></td>
    <td><?= $result['eml']; ?></td>
    <td><?= $results['msg']; ?></td>
    </tr>
 
    <?php }
?>
***********************************************************************************
update.php
**********************************************************************************
<?php
include('db.php');


$select = "select * from emp where id='".$_REQUEST['id']."'";
$query= mysql_query($select);

 $result = mysql_fetch_array($query);

if(isset($_POST['update'])){
$name = $_POST['nm'];
$email = $_POST['eml'];
$message = $_POST['msg'];
$insert = "update emp set name='".$_REQUEST['nm']."', email='".$_REQUEST['eml']."', message='".$_REQUEST['msg']."' where id='".$_REQUEST['id']."'";
mysql_query($insert);
header('location: list.php');
}
?>
<form name="frm" method="post">
<table align="center" width="500px;" border="2px solid black;">
<tr>
<td>Name</td>
<td><input type="text" name="nm" value="<?php echo $result['name']; ?>" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="eml" value="<?php echo $result['email']; ?>" /></td>
</tr>
<tr>
<td>Message</td>
<td><input type="text" name="msg" value="<?php echo $result['message']; ?>" /></td>
</tr>
<tr>
<td><input type="submit" name="update" value="update" /></td>
</tr>

</table>
</form>
******************************************************************************
view.php
*************************************************************************
<?php
include('db.php');

$insert = "select * from emp where id='".$_REQUEST['id']."'";
$query = mysql_query($insert);
$result = mysql_fetch_array($query);


?>
<form name="frm" method="post">

<table align="center" width="500px;" border="2px solid black;">
<tr>
<td>Name</td>
<td><?php echo $result['name']; ?></td>
</tr>
<tr>
<td>Email</td>
<td><?php echo $result['email']; ?></td>
</tr>
<tr>
<td>Message</td>
<td><?php echo $result['message']; ?></td>
</tr>
<tr>
<td><a href="list.php">Back</a></td>
</tr>

</table>
</form>
*********************************************************************************
delete.php
******************************************************************************
<?php
include('db.php');
$sql = "delete from emp where id='".$_REQUEST['id']."'";
mysql_query($sql);
header('location: list.php');
?>


**********************************************************************
HOW TO PRINT CURRENT DATE & UPCOMING DATE
==================================================================
<?php echo "Today Is :"."&nbsp;".date("l")."&nbsp;".date("Y-m-d")."<br>";
             $da = date("l");
//$da = "Saturday";

             if(($da === 'Monday') || ($da === 'Tuesday')){
echo " Your first delivery will arrive on the Next Monday "."&nbsp;".date('Y-m-d', strtotime('next monday'));
 }
 elseif(($da === 'Wednesday') || ($da === 'Thursday')){
echo " Your first delivery will arrive on the Next Wednesday"."&nbsp;".date('Y-m-d', strtotime('next wednesday')) ;
 }
 elseif(($da === 'Friday') || ($da === 'Saturday') || ($da === 'Sunday')){
 echo " Your first delivery will arrive on the Next Friday"."&nbsp;".date('Y-m-d', strtotime('next friday')) ;
 }
?>
------------------------------------------------------------------------------------------
SOME IMP CODE FOR PRINT DATE
 <?php //echo  date("Y-m-d H:i:s", Mage::getModel('core/date')->timestamp(time())); ?>
    <?php //echo $weekBeginning = date('Y-m-d', Mage::getModel('core/date')->timestamp(strtotime('last monday')));
    ?>
<?php //echo "tody is" . date("l"); ?>


J QUERY
-----------------

<p id="demo"></p>
 
    <script>
document.getElementById("demo").innerHTML = Date();
</script>

***********************************************************************
Mail.PHP(attach mail in html site without database)
-------------------------------------------------------------------
<?php
$email = $_POST['email'];
$mess = 'Name :'.$_POST['name'].'<br> Phone No.  :'.$_POST['phone'].'<br> Company Name :'.$_POST['company'].'<br>Message : '.$_POST['message'];

$to      = 'info@abitsingapore.com';
$subject = 'the subject';
$message = $mess;
$headers = 'From: $email ' . "\r\n" .
    'Reply-To: $email ' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
***********************************************************************
SET DYNAMIC MENU USING SESSION
-------------------------------------------------------------------
INDEX.PHP
-----------------------------------
<?php session_start(); ?>

<?php
$_SESSION['nav'] = 1;
 ?>
-------------------------------------------------------------
MENU.PHP
----------------------------------------------
where current-menu-item is active class name
<ul id="main_menu" class="sf-js-enabled"><!--<li id="magic-line" style="left: 0px; width: 81px;"></li>-->

<li class="<?php if($_SESSION['nav'] ==1){echo 'current-menu-item';} ?>">
<a href="index.php"><span>Home</span></a> </li>

<li class="<?php
if($_SESSION['nav'] ==2){
echo 'current-menu-item';
}
?>">
<a href="portfolio.php"><span>Portfolio</span></a> </li></ul>
==========================================================
send_mail.php
------------------------------------------------------------
<?php 
if(isset($_POST['submit'])){
    $to = "tiwarilalit0027@gmail.com"; // this is your Email address
    $from = $_POST['email']; // this is the sender's Email address
    $name = $_POST['name'];
    $number = $_POST['number'];
    $message = $_POST['message'];
    $subject = "Message From ABBP";
   $subject2 = "Thanks For ABBP  ";
     $message = $name . " " . $number . " wrote the following:" . "\n\n" . $_POST['message'];
    
    $headers = "From:" . $from;
    $headers2 = "From:" . $to;
    mail($to,$subject,$message,$headers);
    mail($from,$subject2,$message,$headers2); // sends a copy of the message to the sender
    echo "Mail Sent. Thank you " . $name . ", we will contact you shortly."; ?>
   <script>window.location.href='contact.php';
   </script>
    
  <?php    
}
?>
---------------------------------------------------------------------------------------
contact_us.php
---------------------------------
<form method="post" action="send_mail.php">
 <div class="row clearfix">
<div class="col-md-4 col-sm-12 col-xs-12 form-group">
<input type="text" name="name" placeholder="Name *" required="">
</div>
<div class="col-md-4 col-sm-6 col-xs-12 form-group">
<input type="email" name="email" placeholder="Email *" required="">
</div>
<div class="col-md-4 col-sm-6 col-xs-12 form-group">
<input type="text" name="number" placeholder="Phone *">
</div>
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 form-group">
<textarea name="message" placeholder="Message"></textarea>
</div>
<div class="col-lg-12 text-center col-md-12 col-sm-12 col-xs-12 form-group">
<button class="theme-btn btn-style-one" type="submit" name="submit" value="submit">Submit</button>
</div>
</div>
</form>
*****************************************************
MY CRUD in PHP (Developed by self 8/30/22)
------------------------------------
 folder name ->crud-demo
1- First create Database, tables and connection.php
2- Create Insert form and data inserted here
   first include connection.php every page
3- View.php
4- update.php
5- Delete.php
---------------------
------connection.php--------------
<?php
$host="localhost";
$username="root";
$password="";
$db="crud_demo";

$con= mysqli_connect($host,$username,$password,$db);

// Create connection
//$conn = mysqli_connect('localhost','root','','dbtest');

if($con){
//echo "DB Connected Successfully";
}
else {
echo "DB not connected. Please check";
}
?>
--------------index.php--------------
<?php include("connection.php"); ?>
<html>
<head>
<title> PHP Crud Demo</title>
</head>
<body>
<div>
<form action="" method="post">
<input type="text" name="first_name" Placeholder="Enter your First Name"> <br><br>
<input type="text" name="last_name" Placeholder="Enter your Last Name"> <br><br>
<input type="number" name="age" Placeholder="Enter your Age"> <br><br>

<input type="submit" name="save_btn" value="Save">
<button> <a href="view.php">View</a></button>
</form>
</div>
<?php
if (isset($_POST['save_btn'])) {
$fname=$_POST['first_name'] ;
$lname=$_POST['last_name'];
$age=$_POST['age'];

$query="INSERT INTO student (firstname,lastname,age) VALUES('$fname','$lname','$age')";
$data=mysqli_query($con,$query);
 
 if($data){
?>
<script>
alert('Data Inserted Successfully');
window.open("http://abc/crud-demo/view.php", "_self")
</script>
<?php 
 }
 else {
?>
<script>
alert('Data Not Inserted. Please try again');
</script> 
<?php 
 }

}
if (!isset($_POST['save_btn'])) {
?>
<script>
alert('Data Not Inserted. Please try again');
</script> 
<?php 
}
?>
</body>
</html>
--------view.php--------------
<?php include('connection.php'); ?>
<a href="index.php">Home</a>
<html>
<head>
<title> PHP Crud Demo</title>
</head>
<body>
 <table border="1px solid #000" cellpadding='10px' cellspacing="0">
 <tr> 
 <th>ID</th>
 <th>First Name</th>
 <th>Last Name</th>
  <th>Age </th>
  <th>Actions </th>
  <th><a href="index.php">Add</a> </th>
 </tr>
 <?php 
 $query="SELECT * FROM student";
 $data=mysqli_query($con,$query);
 $result=mysqli_num_rows($data);
 if($result > 0 ) {
   echo "record found";
   While($row=mysqli_fetch_array($data)) {
     ?>
           <tr> 
           <td><?php echo $row['id']; ?></td>
           <td><?php echo $row['firstname']; ?></td>
           <td><?php echo $row['lastname']; ?></td>
           <td><?php echo $row['age']; ?></td>
           <td><a href="update.php?id=<?php echo $row['id']; ?>">Edit</a> | <a onclick="return confirm('Are you sure, you want to delete?')" href="delete.php?id=<?php echo $row['id']; ?>">Delete</a></td>
 </tr>
 <?php
   }
 }
 else {
  echo "record not found";
 }
 ?>
 </table>
</body>
</html>
----------------update.php--------------
<?php include("connection.php"); 
  $id= $_GET['id'];
  //echo $id
  $query="SELECT * FROM student WHERE id='$id'";
  $data=mysqli_query($con,$query);
  $row=mysqli_fetch_array($data);
?>
<div>
<form action="" method="post">
<input type="text" name="first_name" value="<?php echo $row['firstname'] ?>" Placeholder="Enter your First Name"> <br><br>
<input type="text" name="last_name" value="<?php echo $row['lastname'] ?>" Placeholder="Enter your Last Name"> <br><br>
<input type="number" name="age" value="<?php echo $row['age'] ?>" Placeholder="Enter your Age"> <br><br>
<input type="submit" name="update_btn" value="Update">
<button> <a href="view.php">Back</a></button>
</form>
<?php
if( isset($_POST['update_btn']) ) {
$fname=$_POST['first_name'];
$lname=$_POST['last_name'];
$age=$_POST['age'];

$update="UPDATE student SET firstname='$fname', lastname='$lname', age='$age' WHERE id='$id'";
$data=mysqli_query($con,$update);
if($data){
  ?>
  <script>
    alert('Data Updated Successfully');
    window.open("http://abc/crud-demo/view.php", "_self");
    </script>
<?php
}
else {
    ?>
    <script>
      alert('Data Not Updated. Please check & try again');
      </script>
  <?php
}
}
?>
</div>
--------------delete.php--------------
<?php include("connection.php");
 $id=$_GET['id'];
 //echo $id;
//exit();
$delete="DELETE FROM student WHERE id='$id'";
$data=mysqli_query($con,$delete);

if($data) {
  ?>
     <script>
          alert("Data Deleted Successfully");
          window.open("http://abc/crud-demo/view.php", "_self")
     </script>
  <?php
}
else {
    ?>
    <script>
         alert("Data Not Deleted. Please check & try again");
    </script>
 <?php
}
?>
********************************************************************************
-----MYSQL QUERYIES---------------------
$con= mysqli_connect($host,$username,$password,$db);
// Create connection
//$conn = mysqli_connect('localhost','root','','dbtest');
----------------------------------------
$query="INSERT INTO student (firstname,lastname,age) VALUES('$fname','$lname','$age')";
$data=mysqli_query($con,$query);
------------------------------------
$query="SELECT * FROM student";
$data=mysqli_query($con,$query);
 $result=mysqli_num_rows($data);
  While($row=mysqli_fetch_array($data)) {
------------------------------------------------
$id= $_GET['id'];
  //echo $id
  $query="SELECT * FROM student WHERE id='$id'";
  
  if( isset($_POST['update_btn']) ) {
$fname=$_POST['first_name'];
$lname=$_POST['last_name'];
$age=$_POST['age'];
$update="UPDATE student SET firstname='$fname', lastname='$lname', age='$age' WHERE id='$id'";
}
-------------------------------------------------------------
$delete="DELETE FROM student WHERE id='$id'";
$data=mysqli_query($con,$delete);
=============================================================
php file upload size limit validation in xampp
-----------------------------------------------------------------------------------------------------

Try increasing the following values in php.ini, for example:

memory_limit = 1024M
upload_max_filesize = 56M
post_max_size = 128M

to phpmyadmin/config.inc.php

And Change php.ini and my.ini

  • post_max_size = 750M
  • upload_max_filesize = 750M
  • max_execution_time = 5000
  • max_input_time = 5000
  • memory_limit = 1000M
  • max_allowed_packet = 200M (in my.ini)

If you are xampp please go to

xampp\phpMyAdmin\libraries\config.default.php

Search for : $cfg[‘ExecTimeLimit’] = 600;

You can change ‘600‘ to any higher value, like ‘6000‘.

Maximum execution time in seconds is (0 for no limit).

=========================================================

Problem changing from PHP 5.6 to PHP 7.2

Fatal error: Declaration of NTN_Walker_Nav::start_el(&$output, $item, $depth, $args) must be
compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = null, $id = 0)
in H:\xampp\htdocs\wp\abc\wp-content\themes\abc-theme\inc\class-extends.php on line 14
--------------------------------------------------------

Search the theme files for the function definition of start_el() inside the description_walker class. The line of code should look similar to this:

function start_el( $output, $item, $depth, $args ) {

Changing this line to the following should make the warning disappear:

function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
=============================================================
Important Links
----------------------------------------------------------------------------------

http://www.bccfalna.com/website-vs-blog-short-sweet-and-simple-difference/
http://www.slideshare.net/vineetkumarsaini?utm_source=uploader_profile&utm_medium=ssemail&utm_campaign=upload_digest

https://www.geekyshows.com/
https://www.youtube.com/watch?v=n0xJk4iGO78&list=PLozpfQW4uw21RcDXeUTrAf1_-P7cP6HmL&index=4
php https://www.youtube.com/watch?v=QsAVoLPqkRQ&list=PLWCLxMult9xfYlDRir2OGRZFK397f3Yeb
Mobile app https://www.youtube.com/watch?v=aG9ssTDve94
Material design form
https://www.youtube.com/watch?v=rZ-aB10tLVQ
https://material.io/develop/web/getting-started

WORDPRESS

Complete WordPress Installation Process  Then follow this process Theming

**********************************************************************
Copy Paste css in WP-css and remove ....../ before the images
Copy  Paste images in WP-images
Copy  Paste header in WP-header.php
Copy  Paste footer in WP-footer.php

OR
CALL CSS AND JQUERY IN HEADER.PHP
css, jquery paste asitic in wordpress folder OR css put in css folder and jquery put in js folder
and call in header.php change folder name  and file name
call css in header.php b/w head section  or below this code <?php wp_head(); ?>

<link rel="stylesheet" href="<?php bloginfo('template_directory'); ?>/css/boilerplate.css" type="text/css"
media="screen" />

call js in header.php b/w head section  or below this code <?php wp_head(); ?>

<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/jquery-1.11.0.min.js"></script>

<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/js/om sai.js"></script>
------------------------------------------------------------------------------------------------
CALL CSS AND JQUERY IN HEADER.PHP USING wp_enqueue_script FUNCTION    

function custom_theme_scripts() {
    wp_enqueue_style( 'style-name', get_stylesheet_uri() );
    wp_enqueue_script( 'script-name', get_template_directory_uri() . '/css/custom_style.css', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'custom_theme_scripts' );

--------------------------------------------------------
call images put this code <img src="<?php bloginfo( 'template_url' ); ?>/images/logo.png">
*************************************************************************
DYNAMIC PRIMARY MENU
---------------------------------------------------------------------
paste this code when you want
<?php wp_nav_menu( array( 'theme_location' => 'primary', 'menu_class' => 'nav-menu' ) ); ?>
*************************************************************************
*********************************************************************
DYNAMIC FOOTER MENU---------------------------------------------------------------------
paste this code when you want in footer.php
<?php wp_nav_menu( array( 'theme_location' => 'footer', 'menu_class' => 'fmenu' ) ); ?>

GO FUNCTION.PHP MAKE FOOTER MENU
-------------------------------------------------------------------------------------
paste this code below the primary menu
register_nav_menu( 'footer', __( 'Footer Menu', 'twentythirteen' ) );

***********************************************************************
how to hide http from Site_url in wordpress (Home_URL & Site_URL now remove the colon from “http://”)
https://wordpress.stackexchange.com/questions/280311/how-to-remove-http-when-echoing-url

   $url = site_url();
  echo $url; 
$str = site_url();
$str = preg_replace('#^https?://#i', '', $str);
echo $str;
**************************************************************************************
CALL HEADER ,FOOTER & SIDE_BAR
--------------------------------------------------------------------
paste this code when you want
<?php
/**
 * The template for displaying all pages.
 * Template Name: Home
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages and that other
 * 'pages' on your WordPress site will use a different template.
 *
 * @package WordPress
 * @subpackage Twenty_Thirteen
 * @since Twenty Thirteen 1.0
 */

get_header(); ?>

<?php get_sidebar(); ?>
<?php get_footer(); ?>
***********************************************************************
How to Create Custom Template In Page, Post, Product
-----------------------------------------------------------------------
PAGE
<?php
/*
* Template Name: Homepage
*
*/
get_header(); ?>
-------------------------------
POST
<?php
/*
*   Template Name: Homepage
*   Template Post Type: Post
*
*/
get_header(); ?>
--------------------------------------------------------------------
PRODUCT
<?php
/*
* Template Name: Single Product New Design
*   Template Post Type: product
*
*/
get_header(); ?>
***********************************************************************
How TO Create Template Go Page.php copy & paste Change name home.php
write Template Name: Home (this code write below * The template for displaying all pages) the and call side bar if you need or want
and create page HOME  and this page below update in same page select Template Home by default select default template
******************************************************************************
HOW TO CREATE CUSTOM POST TYPES (CPT) function.php
-------------------------------------------
function create_posttype() {
register_post_type( 'ceomessages',
// CPT Options

array(
  'labels' => array(
   'name' => __( "Ceo's Message" ),
   'singular_name' => __( 'Ceomessages' )
  ),
  'public' => true,
  'has_archive' => false,
  'rewrite' => array('slug' => 'ceomessages'),
 )
);
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );

/* Custom Post Type End */

/*Custom Post type ceo message start*/

function cw_post_type_ceomessages() {

$supports = array(
'title', // post title
'editor', // post content
'author', // post author
'thumbnail', // featured images
'excerpt', // post excerpt
'custom-fields', // custom fields
'comments', // post comments
'revisions', // post revisions
'post-formats', // post formats
);

$labels = array(
'name' => _x('Ceo Message', 'plural'),
'singular_name' => _x('ceomessages', 'singular'),
'menu_name' => _x('Ceo Message', 'admin menu'),
'name_admin_bar' => _x('ceomessages', 'admin bar'),
'add_new' => _x('Add New', 'add new'),
'add_new_item' => __('Add New Ceo Message'),
'new_item' => __('New Ceo Message'),
'edit_item' => __('Edit Ceo Message'),
'view_item' => __('View Ceo Message'),
'all_items' => __('All Ceo Message'),
'search_items' => __('Search Ceo Message'),
'not_found' => __('No Ceo Message found.'),
);

$args = array(
'supports' => $supports,
'labels' => $labels,
'public' => true,
'query_var' => true,
'rewrite' => array('slug' => 'ceomessages'),
'has_archive' => true,
'hierarchical' => false,
);
register_post_type('ceomessages', $args);
}
add_action('init', 'cw_post_type_ceomessages');

/**
 * Add custom taxonomies
 *
 * Additional custom taxonomies can be defined here
 * https://codex.wordpress.org/Function_Reference/register_taxonomy
 */
function add_custom_ceomessages_taxonomies() {
  register_taxonomy('ceomessages_categories', 'ceomessages', array(
    // Hierarchical taxonomy (like categories)
    'hierarchical' => true,
    // This array of options controls the labels displayed in the WordPress Admin UI
    'labels' => array(
      'name' => _x( 'Categories', 'taxonomy general name' ),
      'singular_name' => _x( 'Category', 'taxonomy singular name' ),
      'search_items' =>  __( 'Search Category' ),
      'all_items' => __( 'All Category' ),
      'parent_item' => __( 'Parent Category' ),
      'parent_item_colon' => __( 'Parent Category:' ),
      'edit_item' => __( 'Edit Category' ),
      'update_item' => __( 'Update Category' ),
      'add_new_item' => __( 'Add New Category' ),
      'new_item_name' => __( 'New Category Name' ),
      'menu_name' => __( 'Categories' ),
    ),
    // Control the slugs used for this taxonomy
    'rewrite' => array(
      'slug' => 'ceomessages_categories', // This controls the base slug that will display before each term
      'with_front' => false, // Don't display the category base before "/locations/"
      'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"
    ),
  ));
}
add_action( 'init', 'add_custom_ceomessages_taxonomies', 1 ); 

/*Custom Post type CEO MESSGAE  end*/ 

--------------------------------------------------------------------------------
HOW TO GET ALL CUSTOM CATEGORY CPT -> CREATE BELOW TEMPLATE (ABC.PHP)
-------------------------------------------------------------------------------------

<?php
/*Template Name: Ceo Messages*/
get_header();
?>
<div class="ceo_messages">
 <ul>
 <?php
   $wcatTerms = get_terms(
   'ceomessages_categories', array( 'hide_empty' => 0, 'number' => 'all', 'orderby' => 'ID', 'order' =>'ASC', 'parent' => 0, 'supports' => array("thumbnail")));
        foreach($wcatTerms as $wcatTerm) :
   $image = get_field('category_image', 'category_' . $wcatTerm->term_id . '' );?>
  <li><a href="<?php echo get_term_link( $wcatTerm->slug, $wcatTerm->taxonomy ); ?>">
<figure> <?php echo '<img src="' . $image['url'] . '" width="100%" /> '; ?> </figure>
<span class="crp_title"> <?php echo $wcatTerm->name; ?> </span>
</a></li>
   <?php
                    $args = array(
                        'post_type' => 'ceomessages',
                        'order' => 'ASC',
'orderby' => 'ID',
                        'tax_query' => array(
                            array(
                                'taxonomy' => 'ceomessages_categories',
                                'field' => 'slug',
                                'terms' => $wcatTerm->slug,
                            )
                        ),
                        'posts_per_page' => 1
                    );
                    $loop = new WP_Query( $args );
                    while ( $loop->have_posts() ) : $loop->the_post();
                    $imgurl = get_the_post_thumbnail_url( get_the_ID(), 'full' );
                    $title=get_the_title($post->ID);
                ?>
<?php //echo $title; ?>
  <?php endwhile; wp_reset_postdata(); ?> 
     <?php endforeach;  ?>
</ul>
</div>
  <?php get_footer(); ?>
  ------------------------------------------------------------------
  HOW TO CREATE SEPARATE CATEGROY PAGES USING (CATEGORY-{REGISTER-TAXONOMY-NAME}.PHP)
  
  <?php
/*
Template Name: Archives ceomessages
*/
   get_header(); 
//get_template_part('blog'); 
    //echo "test";
    ?>
<div class="ceo_messages">
 <ul>
<?php
$args = array(
'post_type'=> 'ceomessages',
'orderby'    => 'ID',
'post_status' => 'publish',
'order'    => 'DESC',
'posts_per_page' => -1 // this will retrive all the post that is published 
);
$result = new WP_Query( $args );

$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); 

if ( $result-> have_posts() ) : ?>
<?php while ( $result->have_posts() ) : $result->the_post(); ?>
 <li>
<figure> <?php echo the_post_thumbnail(); ?> </figure>
 <a href="<?php the_permalink(); ?>">
 <span class="crp_title"> <?php the_title(); ?>   </span> 
 </a>
<?php endwhile; ?>
</li>
<?php endif; wp_reset_postdata(); ?>

</ul>
</div>
                
 <?php get_footer(); ?>
 *******************************************************************************

CREATE DYNAMIC SIDEBAR

***********************************************************************
GO FUNCTION.PHP COPY & PASTE
-------------------------------------------------------------------------
CALL HOME OR ANY PAGE PUT THIS CODE AS YOU WANT
 <?php if ( dynamic_sidebar('sidebar-6') ) : else : endif; ?>
CAll admin dashboard page [widget id="text-6"]
--------------------------------------------------------------
go function.php copy paste side bar code & edit side bar name
register_sidebar( array(
'name' => __( 'lalit', 'twentyeleven' ),
'id' => 'sidebar-6',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => "</aside>",
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
*******************************************************************
ACF plugin to create extra field
-------------------------------
Name-> date_of_birth, permanent_address, department, designation, mobile_no

and how to show in frontend
$author_id = get_the_author_meta('ID');
$author_field = get_field('author_title', 'user_'. $author_id );

$current_user = wp_get_current_user();
<?php echo $current_user->display_name; ?> 
 <?php echo $current_user->ID; ?>
 $date_of_birth = get_field('date_of_birth', 'user_'. $current_user->ID );
echo $date_of_birth;
<?php $permanent_address = get_field('permanent_address', 'user_'. $current_user->ID );  
  echo $permanent_address;  
  <?php the_field('display_name', 'user_'. $current_user->ID ); ?> 
<?php the_field('mobile_no', 'user_'. $current_user->ID ); ?>

**********************************************************************
if elseif else condition in ACF Plugin ------------------------------------
<?php if(get_field('mp4_video')){ $mp4_video = get_field('mp4_video'); //echo $mp4_video; //echo wp_video_shortcode( $mp4_video ); echo'<video width="400" controls><source src="'.$mp4_video.'" type="video/mp4"></video>'; } else if(get_field('mp3_audio')){ $mp3_audio = get_field('mp3_audio'); echo'<audio controls><source src="'.$mp3_audio.'" type="audio/mpeg"></audio>'; } else if(get_field('custom_image_upload')){ $custom_image_upload = get_field('custom_image_upload'); echo'<img src="'.$custom_image_upload.'" alt="no image found">'; } else { $default_image= "https://trenttalks.binaryic.co.in/wp-content/uploads/2022/08/comming_soon.jpg"; $default_image= "https://trenttalks.binaryic.co.in/wp-content/uploads/2022/08/comming_soon.jpg"; echo'<img src="'.$default_image.'" alt="no image found">'; } ?>
*************************************************************************  

INSTALL NIVO SLIDER 0.3.3 PLUGIN FOR DYNAMIC SLIDER AND ACTIVATE

******************************************************************
then go ->Add/Edit Image add 1,2,3.... images as you want  and then go ->Options  manage width
, height. Transition speed, Transition effect and Pause time between the transitions

paste this code as you want
<?php if (function_exists('nivoslider4wp_show')) { nivoslider4wp_show(); } ?>

when show only front page or home page use this code
<?php if(is_front_page() || is_home() ) { ?>show only front page paste b/w this place <?php } ?>

nivo slider 3.1 plugin
shortcode
<?php if ( function_exists('show_nivo_slider') ) { show_nivo_slider(); } ?>
********************************************************************************

INSTALL NextGEN Gallery 2.0.40 FOR GALLERY PAGE

*************************************************************************
install nextgen gallery plugin activate then go->dashboard side bar icon(Gallery)->Add Gallery/images->our new gallery->add files->select and open->start upload->manage galleries->click->our new gallery->change title and etc. ->sort order->then open ->gallery page->click visual-> click nextgen gallery icon->what would you like to display page->select ->our new gallery->customize the display settings->override thumbnail settings->select yes->save->update page

********************************************************************************

INSTALL EASING SLIDER PLUGIN FOR DYNAMIC SLIDER AND ACTIVATE

GO -> PLUGIN->ADD NEW->search->easing slider->install now->activate->Slideshow->Edit slide show->Dimension->width 960->height->250->Add images->save slideshow->Displaying slideshow->Function in template files(via php)-><?php if ( function_exists( "easingsliderlite" ) ) { easingsliderlite(); } ?>->copy this code->back to dashboard->Go to appearance->Editor->Header.php(side bar)=>paste this code as you want <?php if ( function_exists( "easingsliderlite" ) ) { easingsliderlite(); } ?>=>update
******************************************************************
WordPress RESPONSIVE photo gallery PLUGIN 

*********************************************************************
1. SIMPLE RESPONSIVE SLIDER PLUGIN (USE FOR SLIDER)
2. WordPress responsive photo gallery
3. Nextgen Gallery
**********************************************************************************
EVENTS PLUGIN
*****************************************************************
1. Event List plugin
2. calender 
3. Events manager
************************************************************
CAREERS PAGE PLUGIN
************************************************************
1.Resume Submissions & Job Postings
2.WP Job Manager
************************************************
TESTIMONIAL PLUGIN
*************************************************************
Testimonial Rotator
2 Manage Scrolling Testimonial 
Testimonials Slider(responsive)  
**********************************************************************************
This plugin use for video gallery
----------------------------------------------

1. HDW WordPress Video Gallery(no title & description)

2. WordPress Video Player with title & description
------------------------------------------------
Wp website set front End Password PLUGIN
plugin: Password Protected
*************************************************************************
Free SSL activated Wp Websites PLUGIN
plugin: WP Encryption – One-Click Free SSL Certificate & SSL / HTTPS Redirect to fix Insecure Content
https://www.youtube.com/watch?v=KQ2HYtplPEk

Free SSL websites
https://www.sslforfree.com/
https://letsencrypt.org/
-------------------------------------------------------

how to migrate Wp Websites  using hostinger Server

Using Hostinger Account -> Login->click Hosting->Add Website->enter domain name  ex.(abc.com) and put any password->click add website->then click on Bag icon (Hosting migration request)->Add request-> select domain from dropdown->enter domain name(abc.com)->put wp-admin->enter wp user name & wp password->then select previous hosting
*************************************************************************

WP IMAGE CAROUSEL PLUGIN  USE FOR MOVING IMAGES

*******************************************************************
if you want this place this code
[wpic color="gray" visible="4" width="274" height="195" speed="250" auto="0" ][/wpic]

and images paste b/w [wpic] img1 /! img2 /! img3[/wpic]

GO -> PLUGIN->ADD NEW->search->wp image carousel->install now->activate->
settings->size,color,width->visible images->Transition Time->save changes->refresh->copy this code->[wpic color="gray".....] [/wpic]->go to pages->add new page or old page edit ->visual click ->paste code here [wpic]upload image here[/wpic] and images b/w(/!) tag use every image->update

mod_wordpress_magicscroll.zip plugin in wordpress

http://www.youtube.com/watch?v=3zsm1CfBhH8


Image horizontal reel scroll slideshow

[ihrss-gallery type="GROUP1" w="1165" h="125" speed="1" bgcolor="#FFFFFF" gap="5" random="YES"]

this code use in footer or header.php
-------------------------------------------------------------------------------------------------
<div class="bott_slider">
<?php if (function_exists (Ihrss)) Ihrss(); ?>
</div>
----------------------------------------------------------------------------------------------------


http://www.youtube.com/watch?v=Qs8v_G8rgdw

Tiny Carousel Horizontal Slider (USE FOR CAROUSEL BAR)

Easy Testimonials (TESTING PLUGIN)

*****************************************************************
SCROLL TOP TO BOTTOM PLUGIN IN WORDPRESS
*****************************************************************
1. Masterblogster Scroll Top and Bottom (Download and activate plugin)

2. Scroll Top and Bottom (Download and activate plugin and manage settings)
********************************************************************************* 
USING SIDEBAR WIDGETS
********************************************************************************

<div class="left">

<h3 class="heading1">login</h3>


<div class="login">

<div class="format">

<div class="pack">

<span>User Name*</span><input type="text" class="inpt">

<div class="clr"></div>

</div>

<div class="pack">

<span>Password*</span><input type="text" class="inpt">

<div class="clr"></div>

</div>

<div class="pack">

<span><a class="submit" href="#">Login</a></span>

</div>

</div>

<span class="l_span"><a href="#" class="deco">forget your password</a></span><span class="r_span"><a href="#" class="deco">Signup</a></span>

<div class="clr"></div>

</div>


<div class="news">

<h3 class="heading1">News &amp; Events</h3>

<div class="events">

<marquee scrollamount="4"  height="260px" onmouseover="stop()" onmouseout="start()" direction="up"> 

<ul>

<li><b class="col">12th December 2012</b><br>

  <a href="#">Civil Services Exam requires knowledge base

of specified subjects</a>.</li>

<li><b class="col">12th December 2012</b><br>

  <a href="#">Civil Services Exam requires knowledge base

of specified subjects</a>.</li>

<li class="last"><b class="col">12th December 2012</b><br>
  <a href="#">Civil Services Exam requires knowledge base
of specified subjects</a>.</li>
</marquee>
</ul>
</div>

<div class="facebook">
<img src="http://localhost/networldpoint/cms/wordpress/significanceias/wp-content/themes/significanceias/images/facebook.png">
</div>
</div>
</div>
*******************************************
login & logout menu without plugin wordpress
https://crunchify.com/how-to-add-login-logout-button-and-header-menu-to-wordpress-without-any-plugin/
*************************************************************************
RESPONSIVE PLUGIN(SLIDER)
************************************************************************
1. Simple Responsive Slider
2. Meta Slider
**************************************************************************
HOW TO ADD PREVIOUS & NEXT POST OPTION IN SAME POST PAGE(ADD CODE IN SINGLE.PHP)
*************************************************************************
<?php the_content(); ?>

                            <div class="clear20"></div>
                            <div class="row-fluid">
                      <div class="span4 offset2">
                                <?php previous_post_link(); ?>
                                </div>
                                <div class="span4" style="text-align:right;">
                                <?php next_post_link(); ?>
                                </div>
                                <div class="span2"></div>
                            </div>
                            <div class="clear"></div>
*************************************************************************

IMPORTANT WORD PRESS PLUGIN NAME
******************************************************************************
theme-my-login  plugin                 // use for login logout 
wp_touch plugin                          // use for mobile responsive
woocommerce plugin                    // use for shoping site
easingslider or nivo slider plugin     // use for dynamic slider

contact form7  plugin                   // use for contact form
news announcement scroll                // use for latest news
********************************************************************************

IMPORTANT WORD PRESS PHOTO Gallery PLUGIN 
******************************************************************************
nextGen gallery  plugin              // use for gallery
wp-simple-gallery  plugin              // use for gallery

WP Photo Album Plus WordPress plugin   // use for gallery with album
WP Photo Gallery Plugin                // use for gallery with album
****************************************************************
Fancy gallery (radykal) plugin              // use for gallery
add gallary and subgallery
click plus(+) add title and select title then upload images  and click show shortcode button and then show shortcode and this paste any page or place when you want to show gallery
********************************************************************************
HOW TO UPDATE ALL URLS IN DB TABLES USING PLUGIN
------------------------------------------------------------------------------------------------------
1- Go Live Update Urls
2- Velvet Blues Update URLs
3- Elementor -> GO Elementor & click on tools -> replace urls
4- Search & Replace
5- Better Search Replace
******************************************************************

Customize Admin plugin (USE FOR CHANGE WP-ADMIN LOGO)
***************************************************************
install and activate this plugin
and then go to Settings -> in last Customize Admin -> click this-> go custom logo -> upload image -> insert into post
**************************************************************
SAME AS Above process(is best)
Custom Logo plugin              // use for Change Logo
------------------------------------
Slick Contact Forms Plugin      // use for toggle
WP-VERTICAL-GALLERY
wp-lightbox-2
wp-dreamworkgallery
slideshow-jquery-image-gallery
photospace
nimble-portfolio.1.3.2
light-plus2.6
cyclone-slider-2.2.6.4
revslider



hc custom wp-admin url
horizontal scrolling plugin
horizontal scroll image slideshow
simple basic contact form ************************************************************************
HOW TO CHANGE PAGE URL(MEANS ID CONVERT PAGE NAME)
Change permalinks
********************************************************************
DOWNLOAD PDF LINK
*******************************************************************
STEP-1.Jaise image upload karte hai waise pdf uploa kar dejea, or
STEP-2.wp-admin->Media->open downled pdf
STEP-3.and give its as a <a href="url">

Remove Rid from Admin Bar 
***********************************************************************
Put this in function.php 
add_filter('show_admin_bar', '__return_false');
******************************************************************************* 
NOTE:WHEN CREATE POST THEN POST NOT SHOW MENUS always
Not open any link in categories then go dashboard->settings->permalinks->custom structure_>http://localhost/networldpoint/cms/wordpress/wordpress2-> paste this code /%postname%/

Contact 7 page redirect url
**********************************************************************
put the code in 
on_sent_ok: "location.replace('http://errorfound.in/significance/?page_id=9');"
******************************************************************************
contact form 7 manage fields
*******************************************************************************
<p>
    [text* your-name  placeholder"Your Name"] </p>

<p>
    [email* your-email  placeholder"Your Email Address"] </p>

<p>
[tel* tel-694 placeholder"Your Contact No."]</p>

<p>
    [text* your-subject placeholder"Your Highest Qualification"] </p>


<p>[submit "Send"]</p>


<p>[file file-507 filetypes:gif|png|jpg|jpeg|pdf|docx|xlsx]</p>

<div class="attach">Attach your Word / Pdf / Jpg / Excel / ....etc.  Files</div>

Message='Thanks for interests in Osr group We will get back to you soon'
**********************************************************************
CALL CONTACT FORM 7 IN PHP PAGE
**********************************************************************
<?php echo do_shortcode('[contact-form-7 id="37" title="Contact form 1"]');
?>
**********************************************************************
paste the id from paramlinks
******************************************************************  
<?php $id=46; $post = get_page($id); echo $post->post_content;  ?>
*********************************************************************
Getting File path in php files 
*********************************************************************************
<?php echo bloginfo( $show ).'<br>';        //wordpress
echo home_url().'<br>';                   //http://127.0.01/wordpress/wordpress1
echo get_theme_root().'<br>';   //C:\xampp\htdocs\wordpress\wordpress1/wp-content/themes
  echo get_template_directory(); ?> //C:\xampp\htdocs\wordpress\wordpress1/wp-content/themes/testing ?>
*************************************************************************
CALL DYNAMIC SLIDER IN ANY PAGE AS YOU WANT(TO GIVE PAGE ID)
*********************************************************************
     <?php $ID = $wp_query->post->ID; //echo $ID; ?>
                <?php if($ID==7) { ?>
                <?php if (function_exists('nivoslider4wp_show')) { nivoslider4wp_show(); } ?>
              <?php } ?>    
**********************************************************************************
Make More Menu in Wp:
**************************************************************************
First make sure you have registered your menus in functions.php:

//register the custom menus
function register_my_menus() {
register_nav_menus(
array(
'profile-menu' => __( 'Primary Menu' )
'services-menu' => __( 'Services Menu' )
)
);
}
add_action( 'init', 'register_my_menus' );
<?php
if (is_page('profile')){
wp_nav_menu(array('menu'=>'primary-menu' ));
} elseif (is_page('services')) {
wp_nav_menu(array('menu'=>'services-menu' ));
}
?>

************************************************************************   
To give home page link
******************************************************************
<a href="#"></a>
paste this code replace #

<?php echo home_url(); ?>
******************************************************************** 
HOW TO CREATE CATEGORY
******************************************************************************
GO->Dashboard->Post->Categories->Add  New Category Name(php,wordpress,joomla magento)->Add New Category->create category successfully
then Go Posts->Add new->(wordpress basic, wordpress advance)->below all categories->tik(check) wordpress->Update
then GO->Appearance->Menus->Categories->Select all->Add to Menu->click Navigation menu or make menu (primary or footer)
*******************************************************************************
HOW TO CREATE CUSTOM LINK (labour law)
*******************************************************************************
GO->Appearance->Menus->Links->URL: http://beurexbird.com/labour/ ,LINK TEXT: labour law->Add To Menu 
then click labour law and write ->Title Attribute-> lalit= then show hover-> labour law-> lalit

IF YOU WANT CUSTOM LINK OPEN IN WINDOW OR TAB

Go->Dashboard->Screen options->Show advanced menu properties->select Link Target
*******************************************************************************
DYNAMIC MAP CODE
********************************************************************************
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d56937.493865657234!2d80.9934556523232!3d26.884657520426455!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x399bfd549ce377af%3A0xb88f53ecb02c52d8!2sIndira+Nagar!5e0!3m2!1sen!2sin!4v1395379385407" width="600" height="450" frameborder="0" style="border:0"></iframe>

*******************************************************************************
<iframe width="366" height="169" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.co.in/maps?q=indira+nagar&amp;ie=UTF8&amp;hq=&amp;hnear=Indira+Nagar,+Lucknow,+Uttar+Pradesh&amp;t=m&amp;source=embed&amp;z=12&amp;ll=26.879893,80.992633&amp;output=embed"></iframe><br /><small><a href="https://maps.google.co.in/maps?q=indira+nagar&amp;ie=UTF8&amp;hq=&amp;hnear=Indira+Nagar,+Lucknow,+Uttar+Pradesh&amp;t=m&amp;source=embed&amp;z=12&amp;ll=26.879893,80.992633" style="color:#0000FF;text-align:left">View Larger Map</a></small>

********************************************************************************
NEWS ANNOUNCEMENT SCROLL PLUGIN USE FOR LATEST NEWS 
***************************************************************************
this code paste if you want any page or post
Short code from version 2.0 to 5.0
[NEWS:TYPE=widget]
Short code from version 6.0 onwards
[news-announcement type="widget"]

or use this
Drag and drop the widget: Go to widget page under appearance tab, drag and drop News announcement scroll widget into your side bar. It’s very easy.
Add directly in the theme: Use this code, <?php if (function_exists (news_announcement)) news_announcement(); ?> to add the plugin to your theme files

GO->Dashboard->Plugin->new->search->news-announcement-scroll->install now -> activate->
GO->SETTINGS->news announcement scroll->add and edit news->And GO->Widget Settings->change
Height, Width, font-size and etc.
**************************************************************************
Localhost image Path
***************************************************************************
src="http://localhost/wordpress/vscity/wp-content/themes/vscity/images/flic.png">

*******************************************************************
LIVE site image PATH
****************************************************************
src="http://www.versatileindia.in/wp-content/themes/versitile/images/Facebook-icon.png"
*********************************************************************************
CALL DYNAMIC CATEGORY AND POST
*********************************************************************************
<?php
            // get all the categories from the database
            $cats = get_categories();

                // loop through the categries
                foreach ($cats as $cat) {
                    // setup the cateogory ID
                    $cat_id= $cat->term_id;
                    // Make a header for the cateogry
                    echo "<h2>".$cat->name."</h2>";
                    // create a custom wordpress query
                    query_posts("cat=$cat_id&posts_per_page=5");
                    // start the wordpress loop!
                    if (have_posts()) : while (have_posts()) : the_post(); ?>

                        <?php // create our link now that the post is setup ?>
                        <a href="<?php the_permalink();?>"><?php the_title(); ?></a>
                        <?php echo '<hr/>'; ?>

                    <?php endwhile; endif; // done our wordpress loop. Will start again for each category ?>
                <?php } // done the foreach statement ?>
********************************************************************************
copy content.php and paste in index.php then show one post in a page

**************************************************************************
 INCREASE IMAGE SIZE
**************************************************************************
memory_limit = 100M
upload_max_filesize = 100M
post_max_size = 200M
file_uploads = On
------------------------------------------------------------------------------------------------------------
save this php.ini and upload in wp-admin
****************************************************************************
 INCREASE PAGES LIMIT & IMAGE SIZE(BOTH)
**************************************************************************
memory_limit = 384M
upload_max_filesize = 100M
post_max_size = 200M
file_uploads = On
max_input_vars = 5000
--------------------------------------------------------------------------------------------------------
WHAT IS NEWSLETTER
*************************************************************
jab koe naya product ya information users ko batani hoti hai to news latter ka use karte hai  ek msg se hi sare users ko info send karte hai jo users suscribe karte hain news latters se.
***************************************************************************************************
MAILCHIMP
**************************************************************************************************
mailchip me users ke pass jab bhi naya chij add karte hai automaticaly mail jati hai
jaisa bhi schedule banate hai
***********************************************************************************************************
HOW TO ADD FONT AWENSOME
************************************************************************************************************
http://fortawesome.github.io/Font-Awesome/3.2.1/icons/
AND CLICK ONE 
<i class="icon-shopping-cart"></i> icon-shopping-cart
this copy and paste in MENU ->cart->Navigation Label
**********************************************************************
CHANGE SITE URL
**********************************************************************
GO DB->Option->Home url->

INSTAAL SEARCH & REPLACE PLUGIN 
AND Select all ID,Post..........

And Replace New Url

******************************************************
TAKE DB & FILES BACKUP 
*****************************************************************

UpdraftPlus WordPress Backup Plugin


******************************************************************************

HOW TO SET CUSTOM FEATURED IMAGE (ANY PAGE, POST & ETC..)


/*-----------------------------custom coding-1------------------------*/

add_action( 'init', 'my_add_excerpts_to_pages' );

function my_add_excerpts_to_pages() {


add_theme_support( 'post-thumbnails', array('news') );



}

/*-----------------------------custom coding 2-------------------------*/
add_action('init', 'OurMenu');

function OurMenu(){
       $OurMenu_args = array(
               'label'        => __('Our Menu'),
               'singular_label' =>        __('Our Menu'),
               'public'        =>        true,
               'show_ui'        =>        true,
               'capability_type'        =>        'news',
               'hierarchical'        =>        false,
               'rewrite'        =>        true,
               'supports'        =>        array('title', 'editor','page-attributes','thumbnail')
               );
               register_post_type('OurMenu', $OurMenu_args);
}
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 132, 133, true );

*********************************************************************************
RESPONSIVE MEDIA QUERY


@media only screen and (min-width:240px) and (max-width: 414px) {

*****************************************

How to display post home page as you want 1,2...or more


---------------------------------------------------------

<?php if (have_posts()) : ?>
<?php $count = 0; ?>

<?php while (have_posts()) : the_post(); ?>
<?php $count++; ?>

<?php if ($count <= 2) : ?>

<h2><a class="permalink" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">
<?php the_title(); ?></a></h2>  

<?php the_content(); ?> // display the full content of the first two posts only

<?php else : ?>

<h2><a class="permalink" href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">     <?php the_title(); ?></a></h2>  // Just the permalinks

<?php endif; ?>
<?php endwhile; ?>

<?php else : ?>

<?php endif; ?>

------------------------------------------------------------------------------------------------------

 <?php if ( have_posts() ) : ?>

<?php /* The loop */ ?>
            
            
             <?php while (have_posts()) : the_post(); ?>
             
      <?php if (++$count > 2) break; ?>
            
<?php get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>

<?php twentythirteen_paging_nav(); ?>

<?php else : ?>
<?php get_template_part( 'content', 'none' ); ?>
        
        
<?php endif; ?>
  ============================================================

WOOCOMMERCE PLUGIN

============================================================= 

Ultimate WooCommerce Brands PLUGIN
------------------------------------------------------
CALL SINGLE CATEGORY ON PAGE OR POST
------------------------------------------------------
[product_category category="medicines" orderby="date"]

WHERE-> medicines is a SLUG NAME

CALL SINGLE product ON PAGE OR POST
------------------------------------------------------
[product id="2"]

********************************************************

How to call link Only Front page

=========================================
 <h4 class="widget-title"><?php if( !is_home() && !is_front_page() ){}else{?><a href="http://unionyogaayurveda.com.hk/news-events/" class="news-home"><?php }  echo $title ?></h4><?php if( !is_home() && !is_front_page() ){}else{?></a> <?php } ?>

***********************************************************************

Custom Post Type

cpt_blog.php
-----------------------------------
<?php
/*
custom post type
*/

// Our custom post type function
function create_posttype() {

    register_post_type( 'blogs',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Blogs' ),
                'singular_name' => __( 'Blog' )
            ),
            'public' => true,
            'has_archive' => true,
            'rewrite' => array('slug' => 'blogs'),
        )
    );
}
// Hooking up our function to theme setup
add_action( 'init', 'create_posttype' );
add_post_type_support( 'blogs', 'excerpt' );
// Register Custom Taxonomy
function custom_taxonomy() {

    $labels = array(
        'name'                       => _x( 'Blog Categories', 'Taxonomy General Name', 'text_domain' ),
        'singular_name'              => _x( 'Blog Categories', 'Taxonomy Singular Name', 'text_domain' ),
        'menu_name'                  => __( 'Blog Categories', 'text_domain' ),
        'all_items'                  => __( 'All Items', 'text_domain' ),
        'parent_item'                => __( 'Parent Item', 'text_domain' ),
        'parent_item_colon'          => __( 'Parent Item:', 'text_domain' ),
        'new_item_name'              => __( 'New Item Name', 'text_domain' ),
        'add_new_item'               => __( 'Add New Item', 'text_domain' ),
        'edit_item'                  => __( 'Edit Item', 'text_domain' ),
        'update_item'                => __( 'Update Item', 'text_domain' ),
        'view_item'                  => __( 'View Item', 'text_domain' ),
        'separate_items_with_commas' => __( 'Separate items with commas', 'text_domain' ),
        'add_or_remove_items'        => __( 'Add or remove items', 'text_domain' ),
        'choose_from_most_used'      => __( 'Choose from the most used', 'text_domain' ),
        'popular_items'              => __( 'Popular Items', 'text_domain' ),
        'search_items'               => __( 'Search Items', 'text_domain' ),
        'not_found'                  => __( 'Not Found', 'text_domain' ),
        'no_terms'                   => __( 'No items', 'text_domain' ),
        'items_list'                 => __( 'Items list', 'text_domain' ),
        'items_list_navigation'      => __( 'Items list navigation', 'text_domain' ),
    );
    $args = array(
        'labels'                     => $labels,
     
        // Features this CPT supports in Post Editor
        'supports'            => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
        // You can associate this CPT with a taxonomy or custom taxonomy.
        'taxonomies'          => array( 'blogs' ),
        /* A hierarchical CPT is like Pages and can have
        * Parent and child items. A non-hierarchical CPT
        * is like Posts.
        */ 
     
        'hierarchical'               => true,
        'public'                     => true,
        'show_ui'                    => true,
        'show_admin_column'          => true,
        'show_in_nav_menus'          => true,
        'show_tagcloud'              => true,
    );
    register_taxonomy( 'taxonomy', array( 'blogs' ), $args );

}
add_action( 'init', 'custom_taxonomy', 0 );

///////////////////////////////
add_theme_support('post-thumbnails');
add_post_type_support( 'blogs', 'thumbnail' );

function create_post_type() {
    register_post_type( 'blogs',
        array(
            'labels' => array(
                'name' => __( 'Blogs' ),
                'singular_name' => __( 'Blog' )
            ),
            'public' => true,
            'has_archive' => true
        )
    );
}
add_action( 'init', 'create_post_type' );
// This theme uses post thumbnails
add_theme_support( 'post-thumbnails', array('blogs', 'post', 'page') );
///////////////

add_action( 'pre_get_posts', 'add_my_post_types_to_query' );

function add_my_post_types_to_query( $query ) {
    if ( is_home() && $query->is_main_query() )
        $query->set( 'post_type', array( 'post', 'blogs' ) );
    return $query;
}

?>
--------------in function.php how to call-------------------
require_once( get_template_directory() .'/template-parts/cpt_blog.php');

note -> template-parts ->folder name
---------------------------
and copy archive.php and rename to archive-blogs.php
and copy single.php and rename to single-blogs.php

===================================================

IF U NEED SHORTCODE Create plugin with generate cpt shortcode

*******************************************************************
<?php
/**
 * Plugin Name: Custom registration by lalit
 * Plugin URI: https:
 * Description: An Custom table register
 * Version: 2.6.13
 * Author: Lalit
 * Author URI: https://lalit.com
 * Requires at least: 4.4
 * Tested up to: 4.7
 *
 * Text Domain: Custom Table
 * Domain Path: 
 *
 * @package Custom
 * @category Custom
 * @author Lalit
 */

?>

<?php //////////////////////////////////////////////////////////////////////////
     echo '<style type="text/css">
.thumb-img {
  float: left;
  margin: 0 15px 0 0;
  width: 46%;
}
.sponsers {display:none;}

.input-sm {
padding: 0 0 0 6px!important;
}
.form-control {
width: 98%;
}
textarea {
width: 95%important;
padding: 6px 3px!important;
}
select.input-sm {
width: 100% !important;
}
input.btn-block[type="submit"], input.btn-block[type="reset"], input.btn-block[type="button"] {
width: 100px!important;
background: #af0101;
border: #af0101;
color:#fff;
}
.pannum {
text-transform: uppercase;
}
</style>
';

function customcpt_workshop() {
?>

   <?php
$args = array( 'post_type' => 'workshops', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
  //the_title();
  echo '<div class="entry-content">'; ?>
  

  <div class="col-xs-6 col-sm-3"><div class="list_block">
            
            <?php $format = get_post_format(  get_the_id() );
                                      $post_meta = get_post_meta(get_the_id() ,'_dt_post_settings',TRUE);
                                      $post_meta = is_array($post_meta) ? $post_meta  : array();
  
  $dttheme_options = get_option(IAMD_THEME_SETTINGS);
      $dttheme_general = $dttheme_options['general']; 
  $enable_placeholder =  array_key_exists('disable-posts-placeholder',$dttheme_general) ? true : false; ?>
                                      
                                    <?php if( $format === "image" || empty($format) ): ?>
                                        <a href="<?php the_permalink();?>" title="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>">
                                        <?php if( has_post_thumbnail() ):
                                                the_post_thumbnail("full");
                                              else:
if($enable_placeholder){ ?>
                                                  <img src="http://placehold.it/1060x636&text=Image" alt="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>" title="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>" />
                                        <?php   } endif;?>
                                        </a>
                                <?php elseif( $format === "gallery" ):
                                        if( array_key_exists("items", $post_meta) ):
                                            echo "<ul class='entry-gallery-post-slider'>";
                                            foreach ( $post_meta['items'] as $item ) {  
echo "<li><img src='{$item}' alt='blog-gal-image' /></li>"; }
                                            echo "</ul>";
                                        endif;
                    
                                      elseif( $format === "video" ):
                                         if( array_key_exists('oembed-url', $post_meta) || array_key_exists('self-hosted-url', $post_meta) ):
                                            if( array_key_exists('oembed-url', $post_meta) ):
                                                 echo "<div class='dt-video-wrap'>".wp_oembed_get($post_meta['oembed-url']).'</div>';
                                             elseif( array_key_exists('self-hosted-url', $post_meta) ):
                                                  echo "<div class='dt-video-wrap'>".apply_filters( 'the_content', $post_meta['self-hosted-url'] ).'</div>';
                                             endif;
                                          endif;
                                          
                                      elseif( $format === "audio" ):
                                          if( array_key_exists('oembed-url', $post_meta) || array_key_exists('self-hosted-url', $post_meta) ):
                                              if( array_key_exists('oembed-url', $post_meta) ):
                                                  echo wp_oembed_get($post_meta['oembed-url']);
                                              elseif( array_key_exists('self-hosted-url', $post_meta) ):
                                                  echo apply_filters( 'the_content', $post_meta['self-hosted-url'] );
                                              endif;
                                          endif;
                                      else: ?>
                                        <a href="<?php the_permalink();?>" title="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>"><?php
                                            if( has_post_thumbnail() ):
                                                the_post_thumbnail("full");
                                            else:
if($enable_placeholder){ ?>
                                                   <img src="http://placehold.it/1060x636&text=Image" alt="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>" title="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>" />
                                        <?php   } endif;?></a>
                                <?php endif; ?>
            
            <div class="lower_bar text-left"><p class="text-bold text-grey"><a href="<?php the_permalink();?>" title="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>"><?php the_title();?></a></p><p class="text-grey">
            
           <a href="<?php the_permalink();?>" title="<?php printf(esc_attr__('%s'),the_title_attribute('echo=0'));?>"> <?php echo dttheme_excerpt(15);?> </a></p>
           
          <p class="text-greyy read-more-custom">
           
           <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__('%s'), the_title_attribute('echo=0'));?>" class="dt-sc-button small read-more">
                                              <?php _e('Read More','dt_themes');?> </a>
                                                  </p>
                                                </div>   </div></div> 
        <?php                                         
                                                
  //the_content();
  echo '</div>';
endwhile;
?>

<?php }
add_shortcode( 'custom_workshop', 'customcpt_workshop' );

?>
============================================================

CREATE CUSTOM PLUGIN CREATE TABLE IN MYSQL DATABASE
------------------------------------------------------------------------------------------
step 1- create folder under wp plugins folder ->volunteer-registrations
step-2- create page ->volunteer-registrations.php
step3- and put under this code

<?php
/**
 * Plugin Name: Custom Volunteer Registration by lalit
 * Plugin URI: https:
 * Description: An Custom table Volunteer Registration
 * Version: 2.6.13
 * Author: Lalit
 * Author URI: https://lalit.com
 * Requires at least: 4.4
 * Tested up to: 4.7
 *
 * Text Domain: Custom Table
 * Domain Path:
 *
 * @package Custom
 * @category Custom
 * @author Lalit
 */

 function create_volunteer_registration_table(){

 global $wpdb;
 $table_name = $wpdb->prefix . "volunteerregistration";

 $charset_collate = $wpdb->get_charset_collate();
 $sql = "CREATE TABLE IF NOT EXISTS $table_name (
  id int (11) NOT NULL AUTO_INCREMENT,
  photo varchar(255) NOT NULL,
  full_name varchar(255) NOT NULL,
  dob varchar(255) NOT NULL,
  gender varchar(50) NOT NULL,
  nationality varchar(50) NOT NULL,
  blood_group varchar(50) NOT NULL,
  govt_identity_name varchar(255) NOT NULL,
  govt_identity_no varchar(50) NOT NULL,
  email varchar(55) NOT NULL,
  mob_no bigint(10) NOT NULL,
  landline bigint(10) NOT NULL,
  correspondence_address text NOT NULL,
  permanent_address text NOT NULL,
  emerg_name varchar(255) NOT NULL,
  emerg_relation varchar(255) NOT NULL,
  emerg_phone bigint(10) NOT NULL,
  education_level varchar(255) NOT NULL,
  speak_hindi varchar(150) NULL,
  speak_english varchar(155) NULL,
  speak_other varchar(155) NULL,
  write_hindi varchar(150) NULL,
  write_english varchar(155) NULL,
  write_other varchar(155) NULL,
  read_hindi varchar(150) NULL,
  read_english varchar(155) NULL,
  read_other varchar(155) NULL,
  occupation varchar(255) NULL,
  others_occu varchar(255) NULL,
  community_mobilization varchar(150) NULL,
  survey varchar(155) NULL,
  awareness varchar(155) NULL,
  information_technology varchar(150) NULL,
  administrative_work varchar(155) NULL,
  voluntary_others varchar(155) NULL,
  fund_raising varchar(150) NULL,
  documentation_publication varchar(155) NULL,
  preference_servicearea varchar(255) NULL,
  expertise_talents text NOT NULL,
  volunteer_association text NOT NULL,
  refname varchar(150) NOT NULL,
  refaddress text NOT NULL,
  refemail varchar(155) NOT NULL,
  refmobile varchar(155) NOT NULL,
  refRelationship varchar(50) NOT NULL,
  refname2 varchar(55) NOT NULL,
  refaddress2 text NOT NULL,
  refemail2 varchar(50) NOT NULL,
  refmobile2 varchar(55) NOT NULL,
  refRelationship2 varchar(55) NOT NULL,
  p_date DATETIME,
  status int(1) NULL,
  PRIMARY KEY id (id)
) $charset_collate;";

require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
dbDelta( $sql );
 }
 register_activation_hook( __FILE__, 'create_volunteer_registration_table' );

 ?>
-----------------------------------------
step 4- create template under themes folder-> in selected theme->volunteer.php
step 5- and put this code
<?php $con = new mysqli("localhost","root", "", "caritas") or die("could not connect");?>
<?php
error_reporting(1);
/**
 * Template Name:Volunteer Registration Form
 *
 * @package ThinkUpThemes
 */
get_header();

if($_POST['submit']) {
global $wpdb;
$table_name = $wpdb->prefix . "volunteerregistration";
 $tmp_name = $_FILES["photo"]["name"];
 $name = $_FILES["photo"]["tmp_name"];
    $path_array = wp_upload_dir(); // normal format start
    $file_name = pathinfo($tmp_name ,PATHINFO_FILENAME).time().".".pathinfo($tmp_name ,PATHINFO_EXTENSION); 
     $imgtype = strtolower(pathinfo($tmp_name,PATHINFO_EXTENSION));               
     $targetpath = $path_array["path"]."/".$file_name;

//UPLOADS_THEME_PATH."/documents/".$file_name;

    move_uploaded_file($name, $targetpath );
//die();
 //$photo = $_FILE['photo'];

 $full_name = $_POST['full_name'];
 $dob = $_POST['dob'];
 $gender = $_POST['gender'];
 $nationality = $_POST['nationality'];
 $blood_group = $_POST['blood_group'];
 $govt_identity_name = $_POST['govt_identity_name'];
 $govt_identity_no = $_POST['govt_identity_no'];
 $email = $_POST['email'];
 $mob_no = preg_replace('/\s+/', '', $_POST['mob_no']);
 $landline = preg_replace('/\s+/', '', $_POST['landline']);
 $correspondence_address = $_POST['correspondence_address'];
 $permanent_address = $_POST['permanent_address'];
 $ename = $_POST['ename'];
 $relation = $_POST['relation'];
 $ephone = preg_replace('/\s+/', '', $_POST['ephone']);
 $education_level = $_POST['education_level'];
 $speakHindi = $_POST['SpeakHindi'];
 $speakEnglish = $_POST['SpeakEnglish'];
 $speakOtherlan = $_POST['SpeakOtherlan'];
 $writeHindi = $_POST['WriteHindi'];
 $writeEnglish = $_POST['WriteEnglish'];
 $writeOtherlan = $_POST['WriteOtherlan'];
 $readHindi = $_POST['ReadHindi'];
 $readEnglish = $_POST['ReadEnglish'];
 $readOtherlan = $_POST['ReadOtherlan'];
 $occupation = $_POST['occupation'];;
 $others_occupation = $_POST['Others_occupation'];
 $communityMobilization = $_POST['CommunityMobilization'];
 $survey = $_POST['Survey'];
 $awareness = $_POST['Awareness'];
 $information_technology = $_POST['Information_technology'];
 $administrative_work = $_POST['administrative_work'];
 $type_others = $_POST['type_others'];
 $fund_Raising = $_POST['Fund_Raising'];
 $documentation = $_POST['Documentation'];
 $preference_servicearea = $_POST['preference_servicearea'];
 $areaExpertise = $_POST['areaExpertise'];
 $timePeriodVolunteer = $_POST['timePeriodVolunteer'];
 $refname = $_POST['refname'];
 $refaddress = $_POST['refaddress'];
 $refemail = $_POST['refemail'];
 $refmobile = preg_replace('/\s+/', '', $_POST['refmobile']);
 $refRelationship = $_POST['refRelationship'];
 $refname2 = $_POST['refname2'];
 $refaddress2 = $_POST['refaddress2'];
 $refemail2 = $_POST['refemail2'];
 $refmobile2 = $_POST['refmobile2'];
 $refRelationship2 = $_POST['refRelationship2'];
 $p_date = date("Y-m-d H:i:s");

$query2 = "Select * from wpf8_volunteerregistration where email = '$email'";
$result2 = $con->query($query2);
error_log(print_r('query 1 = '.$query2,true));
if($result2->num_rows>0)
{
echo "email already exist";
exit();
}
       
$query1 = "Select * from wpf8_volunteerregistration where mob_no = '$mob_no'";
$result1 = $con->query($query1);

error_log(print_r('query 1 = '.$query1,true));
if($result1->num_rows>0)
{
echo "mobile no already exist";
exit();
}

 $wpdb->insert(
'wpf8_volunteerregistration',
array(
//'photo' => $photo,
'photo'=>$file_name,
'full_name' => $full_name,
'dob' => $dob,
'gender' => $gender,
'nationality' => $nationality,
'blood_group' => $blood_group,
'govt_identity_name' => $govt_identity_name,
'govt_identity_no' => $govt_identity_no,
'email' => $email,
'mob_no' => $mob_no,
'landline' => $landline,
'correspondence_address' => $correspondence_address,
'permanent_address' => $permanent_address,
'emerg_name' => $ename,
'emerg_relation' => $relation,
'emerg_phone' => $ephone,
'education_level' => $education_level,
'speak_hindi' => $speakHindi,
'speak_english' => $speakEnglish,
'speak_other' => $speakOtherlan,
'write_hindi' => $writeHindi,
'write_english' => $writeEnglish,
'write_other' => $writeOtherlan,
'read_hindi' => $readHindi,
'read_english' => $readEnglish,
'read_other' => $readOtherlan,
'occupation' => $occupation,
'others_occu' => $others_occupation,
'community_mobilization' => $communityMobilization,
'survey' => $survey,
'awareness' => $awareness,
'information_technology' => $information_technology,
'administrative_work' => $administrative_work,
'voluntary_others' => $type_others,
'fund_raising' => $fund_Raising,
'documentation_publication' => $documentation,
'preference_servicearea' => $preference_servicearea,
'expertise_talents' => $areaExpertise,
'volunteer_association' => $timePeriodVolunteer,
'refname' => $refname,
'refaddress' => $refaddress,
'refemail' => $refemail,
'refmobile' => $refmobile,
'refRelationship' => $refRelationship,
'refname2' => $refname2,
'refaddress2' => $refaddress2,
'refemail2' => $refemail2,
'refmobile2' => $refmobile2,
'refRelationship2' => $refRelationship2,
'p_date' => $p_date
)
);
//echo $wpdb->last_query;
//die();
$lastid = $wpdb->insert_id;
if($lastid>0)
{
/*echo "<script> window.location.href = 'http://localhost/wp/caritas'; </script>";*/

echo '<script> alert("Thanks Your form is Submitted") </script>';
}

else {
echo '<script> alert("Something is wrong please refresh page and fill again") </script>';
}

}
?>
<div class="clear"></div>

 <head> 
    <style type="text/css">
.thumb-img {
  float: left;
  margin: 0 15px 0 0;
  width: 46%;
}
.sponsers {display:none;}

.input-sm {
padding: 0 0 0 6px!important;
font-size: 14px;
}
.form-control {
width: 100%;
}
textarea {
width: 95%important;
padding: 6px 0 6px 5px !important;
}
select.input-sm {
width: 100% !important;
}
input.btn-block[type="submit"], input.btn-block[type="reset"], input.btn-block[type="button"] {
width: 100px !important;
background: #ccc;
border: #ccc;
color: #000;
font-weight: bold;
}
.pannum {
text-transform: uppercase;
}
.personalinfo {
background: #8D3431;
padding: 4px 37px 25px 28px;
border-radius: 7px;
}
.personalinfo h2 {
    color: #fff;
    font-weight: bold;
    font-size: 18px;
    padding: 11px 0 7px 0;
}
.panel-title {
font-size: 22px!important;
}
</style>
<link href="css/style.css" rel="stylesheet">
<link href="css/bootstrap.min.css" rel="stylesheet">

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
function ValidatePAN() {
  var Obj = $("#panno").val();
        if (Obj != "") {
            ObjVal = Obj;
//alert("jhjk");
            var panPat = /^([a-zA-Z]{5})(\d{4})([a-zA-Z]{1})$/;
            if (ObjVal.search(panPat) == -1) {
                alert("Format Should be 'ABCDE1234A'");
Obj='';
$("#panno").val('');
                $("#panno").focus();
                return false;
            }
          else
            {           
              }
        }
  }
</script>

<script language="Javascript" type="text/javascript">

        function onlyAlphabets(e, t) {
            try {
                if (window.event) {
                    var charCode = window.event.keyCode;
                }
                else if (e) {
                    var charCode = e.which;
                }
                else { return true; }
                if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123) || (charCode==32) || (charCode==8))
                    return true;
                else
                    alert("ENTER ONLY ALPHABATIC VALUE");
                    return false;
            }
            catch (err) {
                alert(err.Description);
            }
        }
 </script>


<script language="Javascript" type="text/javascript">
      function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
         {
             alert("ENTER ONLY NUMERIC VALUE");
            return false;
          }
         else
         {
         return true;
       }
      }
    </script>
   
    <script type="text/javascript">

// Below Function Executes On Form Submit
function ValidationForm() {

// Storing Field Values In Variables
var f_name = document.getElementById("f_name").value;
var address = document.getElementById("address").value;
var address2 = document.getElementById("address2").value;
var city = document.getElementById("city").value;
var state = document.getElementById("state").value;
var postal = document.getElementById("postal").value;
var phoneNumber = document.getElementById("phoneNumber").value;
var email = document.getElementById("email").value;
var panno = document.getElementById("panno").value;
var my_donation = document.getElementById("my_donation").value;
var orderAmount = document.getElementById("orderAmount").value;
if (f_name == ""  || address == "" || address2 == "" || city == "" || state == "" || postal == "" || phoneNumber == "" || email == "" || panno == "" || my_donation == "" || orderAmount == "") {
        alert("all value must be filled out");
        return false;
    }

}
</script>
<!---------------------------------select only one checkbox at atime-------------------->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
</head>

<body>

<div id="contentsec">
    <div class="inner">
        <!-- Columns -->
        <div class="columns">
            <!-- BreadCrumb -->
           <!-- Small side bar left -->
            <div class="static">

<div class="">
        <div class="row centered-form">
        <div class="col-md-12">
        <div class="panel panel-default">
        <div class="panel-heading">
    <h1 class="panel-title">Volunteer Registration Form</h1>
</div>

<div class="donation-text"> <div class="">
</div>
</div>
<div class="panel-body">


<div class="personalinfo">


<form action="#" method="post" name="volunteerForm" class="form_control" onSubmit="return ValidationForm()" enctype="multipart/form-data">
<div class="row">
<div class="col-md-4">
    <div class="form-group">                                   
 <b style="color:#fff;">Reg No.</b>
    </div>
    </div>

<div class="col-md-4">
    <div class="form-group">                                   
<img style="background-color:#fff;padding: 0px 6px;border-radius: 6px;" src="http://localhost/wp/caritas/wp-content/themes/wisdom-responsive/images/logo.png" alt="logo.png">
    </div>
    </div>

<div class="col-md-4">
    <div class="form-group" style="color:#fff;">                                   
<label id="fileLabel">Upload Photo</label>
<input type='file' title="Choose a Photo please" id="photo" name="photo" >
</div></div>
</div>

<h2>1. Personal Particulars</h2>

      <div class="row">
<div class="col-md-12">
    <div class="form-group">                                   
  <input type="text" id="full_name" name="full_name" class="form-control input-sm" placeholder="Full Name*" required="required" onKeyPress="return onlyAlphabets(event,this);" >
    </div>
    </div>
</div>
                           

<div class="row">
<div class="col-md-3">
    <div class="form-group">
    <input type="date" id="dob" name="dob" class="form-control input-sm" placeholder="DOB*" required="required"  onKeyPress="return isNumberKey(event);">
    </div>
    </div>
 
    <div class="col-md-3">
    <div class="form-group">
  <select id="gender" name="gender" class="form-control selectpiker" required="required">
                                                    <option value="">Select Gender*</option>
                                                    <option value="male">Male</option>
                                                        <option value="female">Female</option>
                                                  </select>
  </div>
    </div>

<div class="col-md-3">
    <div class="form-group">
<input type="text" id="nationality" name="nationality" class="form-control input-sm pannu" placeholder="Nationality*" required="required" onKeyPress="return onlyAlphabets(event,this)">
</div></div>

<div class="col-md-3">
    <div class="form-group">
<input type="text" id="blood_group" name="blood_group" class="form-control input-sm pannu" placeholder="Blood Group*" required="required"  onKeyPress="return onlyAlphabets(event,this)">
</div></div>
</div>

<div class="row">
<div class="col-md-6">
    <div class="form-group">
<input type="text" id="govt_identity_name" name="govt_identity_name" class="form-control input-sm pannu" placeholder="Govt. Identity Name*" required="required" onKeyPress="return onlyAlphabets(event,this)">
</div></div>

 <div class="col-md-6">
    <div class="form-group">
<input type="text" id="govt_identity_no" name="govt_identity_no" class="form-control input-sm pannu" placeholder="Govt. Identity No*" required="required">
</div></div></div>


 <div class="row">
    <div class="col-md-4">
    <div class="form-group">
<input type="email" name="email" id="email" class="form-control input-sm" placeholder="Email*" required="required">
    </div>
                            </div>

<div class="col-md-4">
    <div class="form-group">
<input type="text" id="mob_no" name="mob_no" class="form-control input-sm" placeholder="Mobile No.*" required="required" maxlength="10" onKeyPress="return isNumberKey(event)">
    </div>
                                    </div>

    <div class="col-md-4">
    <div class="form-group">
<input type="text" id="landline" name="landline" class="form-control input-sm" placeholder="Landline*" required="required" maxlength="10" onKeyPress="return isNumberKey(event)">
    </div>
                                    </div>  </div>


                           <div class="row">
 
    <div class="col-md-6">
    <div class="form-group">
<textarea id="correspondence_address" name="correspondence_address" placeholder="Correspondence Address*" rows="1" class="form-control" required="required"></textarea>
    </div>
    </div>

<div class="col-md-6">
    <div class="form-group">
<textarea id="permanent_address" name="permanent_address" placeholder="Permanent Address*" rows="1" class="form-control" ></textarea>
    </div>
    </div>
</div>

<div class="row">
<div class="col-md-12">
<h5 style="color:#fff;">In case of emergency notify: </h5>
</div></div>

<div class="row">
<div class="col-md-4">
    <div class="form-group">
    <input type="text" id="ename" name="ename" class="form-control input-sm" placeholder="Name*" required="required"   onKeyPress="return onlyAlphabets(event,this);">
    </div>
    </div>
 
    <div class="col-md-4">
    <div class="form-group">
<input type="text" id="relation" name="relation" class="form-control input-sm" placeholder="Relation*" required="required" onKeyPress="return onlyAlphabets(event,this);">
   </div>
    </div>

<div class="col-md-4">
    <div class="form-group">
<input type="text" id="ephone" name="ephone" class="form-control input-sm" placeholder="Phone*" required="required" MaxLength="10" onKeyPress="return isNumberKey(event)">
</select></div></div>
</div>


<div class="row">
<div class="col-md-12">
<h4 style="color:#fff;">Education Level: </h4>
</div></div>

    <div class="row">
    <div class="col-md-4">

    <div class="form-group">


<select id="education_level" name="education_level" class="form-control selectpiker" required="required">
                                                    <option value="">Select Education Level*</option>
                                                    <option value="Higher Secondary or Below">Higher Secondary or Below</option>
                                                        <option value="Graduate">Graduate</option>
<option value="Post Graduate">Post Graduate</option>
<option value="Above PG">Above PG</option>
                                                  </select>
</div></div>
</div>
                             
 
   <div class="row">
<div class="col-md-12">
<h4 style="color:#fff;">Languages Known: </h4>
</div></div>

<div class="row">
<div class="col-md-12">
<h4 style="color:#fff;">Speak : </h4>
</div></div>
<div class="row"><div class="col-md-4"><div class="form-group">
<span class="highcolor">Hindi</span>
<input type="checkbox" id="SpeakHindi" name="SpeakHindi" value="Hindi" class="form-contro input-s">
</div></div>

<div class="col-md-4"><div class="form-group">
<span class="highcolor">English</span>
<input type="checkbox" id="SpeakEnglish" name="SpeakEnglish" value="English" class="form-contro input-s">
</div></div>

<div class="col-md-4"><div class="form-group">
<span class="highcolor">Other</span>
<input type="text" id="SpeakOtherlan" name="SpeakOtherlan" placeholder="" class="form-contro input-s">
</div></div>
</div>


<div class="row">
<div class="col-md-12">
<h4 style="color:#fff;">Write : </h4>
</div></div>
<div class="row"><div class="col-md-4"><div class="form-group">
<span class="highcolor">Hindi</span>
<input type="checkbox" id="WriteHindi" name="WriteHindi" value="Hindi" class="form-contro input-s">
</div></div>

<div class="col-md-4"><div class="form-group">
<span class="highcolor">English</span>
<input type="checkbox" id="WriteEnglish" name="WriteEnglish" value="English" class="form-contro input-s">
</div></div>

<div class="col-md-4"><div class="form-group">
<span class="highcolor">Other</span>
<input type="text" id="WriteOtherlan" name="WriteOtherlan" placeholder="" class="form-contro input-s">
</div></div>
</div>


  <div class="row">
<div class="col-md-12">
<h4 style="color:#fff;">Read : </h4>
</div></div>
<div class="row"><div class="col-md-4"><div class="form-group">
<span class="highcolor">Hindi</span>
<input type="checkbox" id="ReadHindi" name="ReadHindi" value="Hindi" class="form-contro input-s">
</div></div>

<div class="col-md-4"><div class="form-group">
<span class="highcolor">English</span>
<input type="checkbox" id="ReadEnglish" name="ReadEnglish" value="English" class="form-contro input-s">
</div></div>

<div class="col-md-4"><div class="form-group">
<span class="highcolor">Other</span>
<input type="text" id="ReadOtherlan" name="ReadOtherlan" placeholder="" class="form-contro input-s">
</div></div>
</div>

<hr>
<div class="row">
<div class="col-md-12">
<h2 style="color:#fff;">2. Occupation: </h2>
</div></div>

    <div class="row">
    <div class="col-md-3">
    <div class="form-group">

<span class="highcolor">Student </span>
<input type="checkbox" id="occupation" name="occupation" value="Student" class="form-contro occupation-class">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Govt. Employed</span>
<input type="checkbox" id="occupation" name="occupation" value="Govt. Employed" class="form-contro occupation-class">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Religious</span>
<input type="checkbox" id="occupation" name="occupation" value="Religious" class="form-contro occupation-class">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Others (Please specify)</span>
<input type="text" id="Others_occupation" name="Others_occupation" placeholder="Others" class="form-contro ">
</div></div>
</div>

<div class="row">
    <div class="col-md-3">
    <div class="form-group">
<span class="highcolor">Pvt. Employed </span>
<input type="checkbox" id="occupation" name="occupation" value="Pvt. Employed" class="form-contro occupation-class">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Self Employed</span>
<input type="checkbox" id="occupation" name="occupation" value="Self Employed" class="form-contro occupation-class">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Retired</span>
<input type="checkbox" id="occupation" name="occupation" value="Retired" class="form-contro occupation-class">
</div></div>

<div class="col-md-3"><div class="form-group">

</div></div>
</div>
<script type="text/javascript">
    $('.occupation-class').on('change', function() {
        $('.occupation-class').not(this).prop('checked', false); 
    });
  </script>


<hr>
<div class="row">
<div class="col-md-12">
<h2 style="color:#fff;">3. Types of voluntary Services you want to render (You can choose more than one) </h2>
</div></div>

    <div class="row">
    <div class="col-md-3">
    <div class="form-group">
<span class="highcolor">Community Mobilization </span>
<input type="checkbox" id="CommunityMobilization" name="CommunityMobilization" value="Community Mobilization" class="form-contro input-s">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Survey</span>
<input type="checkbox" id="Survey" name="Survey" value="Survey" class="form-contro input-s">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Awareness</span>
<input type="checkbox" id="Awareness" name="Awareness" value="Awareness" class="form-contro input-s">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Information & technology</span>
<input type="checkbox" id="Information_technology" name="Information_technology" value="Information & technology" class="form-contro input-s">
</div></div>
</div>


<div class="row">
    <div class="col-md-3">
    <div class="form-group">
<span class="highcolor">Administrative work </span>
<input type="checkbox" id="administrative_work" name="administrative_work" value="Administrative Work" class="form-contro input-s">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Others (Please specify)</span>
<input type="text" id="type_others" name="type_others" placeholder="Others" class="form-contro input-s">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Fund Raising</span>
<input type="checkbox" id="Fund_Raising" name="Fund_Raising" value="Fund Raising" class="form-contro input-s">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Documentation & Publication</span>
<input type="checkbox" id="Documentation" name="Documentation" value="Documentation & Publication" class="form-contro input-s">
</div></div>
</div>

<hr>
<div class="row">
<div class="col-md-12">
<h2 style="color:#fff;">4. Preference on service area </h2>
</div></div>

    <div class="row">
    <div class="col-md-3">
    <div class="form-group">
<span class="highcolor">Parish/Local </span>
<input type="checkbox" id="preference_servicearea" name="preference_servicearea" value="Parish/Local" class="form-contro preference-service">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Diocese/District</span>
<input type="checkbox" id="preference_servicearea" name="preference_servicearea" value="Diocese/District" class="form-contro preference-service">
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">Regional/State</span>
<input type="checkbox" id="preference_servicearea" name="preference_servicearea" value="Regional/State" class="form-contro preference-service" >
</div></div>

<div class="col-md-3"><div class="form-group">
<span class="highcolor">National</span>
<input type="checkbox" id="preference_servicearea" name="preference_servicearea" value="National" class="form-contro preference-service">
</div></div>
</div>

<div class="row">
<div class="col-md-3">
    <div class="form-group">
<span class="highcolor">No Preference </span>
<input type="checkbox" id="preference_servicearea" name="preference_servicearea" value="No Preference" class="form-contro preference-service">
</div></div></div>

<script type="text/javascript">
    $('.preference-service').on('change', function() {
        $('.preference-service').not(this).prop('checked', false); 
    });
  </script>

<hr>
<div class="row">
<div class="col-md-12">
<h2 style="color:#fff;">5. Specify your area of Expertise, Talents and Skills (Eg. Photography, Writing, Journalism Etc.) </h2>
</div></div>

    <div class="row">
    <div class="col-md-12">
    <div class="form-group">
<input type="text"  id="areaExpertise" name="areaExpertise" class="form-control input-sm" placeholder="" required="required" onKeyPress="return onlyAlphabets(event,this);" >

</div>
</div></div>
<script type="text/javascript">
    $('.product-list').on('change', function() {
        $('.product-list').not(this).prop('checked', false); 
    });
  </script>


<hr>
<div class="row">
<div class="col-md-12">
<h2 style="color:#fff;">6. Specify the time-period of volunteer association with Caritas India (Mention the start Date) </h2>
</div></div>

    <div class="row">
    <div class="col-md-12">
    <div class="form-group">

<input type="date"  id="timePeriodVolunteer" name="timePeriodVolunteer" class="form-control input-sm" placeholder="Start Date" required="required" onKeyPress="return onlyAlphabets(event,this);" >

</div>
</div>

   

</div>


<hr>
<div class="row">
<div class="col-md-12">
<h2 style="color:#fff;">7. References (Kindly give 2 references)</h2>
</div></div>


<div class="row">
<div class="col-md-12">
<h5 style="color:#fff;">Reference 1 </h5>
</div></div>


<div class="row">
   <div class="col-md-12">
    <div class="form-group">
<input type="text" id="refname" name="refname" class="form-control input-sm" placeholder="Name*" required="required" onKeyPress="return onlyAlphabets(event,this);">
                                 </div>
    </div>
</div>

<div class="row">
   <div class="col-md-12">
    <div class="form-group">
<textarea id="refaddress" name="refaddress" placeholder="Address*" rows="1" class="form-control"></textarea>
    </div>
    </div>
</div>

<div class="row">
<div class="col-md-4">
    <div class="form-group">
<input type="text" id="refemail" name="refemail" class="form-control input-sm" placeholder="Email*" required="required">
    </div>
    </div>
 
    <div class="col-md-4">
    <div class="form-group">

<input type="text" id="refmobile" name="refmobile" class="form-control input-sm" placeholder="Mob. No*" required="required" onKeyPress="return isNumberKey(event)">
  </div>
    </div>

<div class="col-md-4">
    <div class="form-group">
<input type="text" id="refRelationship" name="refRelationship" class="form-control input-sm" placeholder="Relationship*" required="required" onKeyPress="return onlyAlphabets(event,this);">
</div></div></div>

<div class="row">
<div class="col-md-12">
<h5 style="color:#fff;">Reference 2 </h5>
</div></div>


<div class="row">
   <div class="col-md-12">
    <div class="form-group">
<input type="text" id="refname2" name="refname2" class="form-control input-sm" placeholder="Name*" required="required" maxlength="30" minlength="3" onKeyPress="return onlyAlphabets(event,this);">

    </div>
    </div>
</div>

<div class="row">
   <div class="col-md-12">
    <div class="form-group">
<textarea id="refaddress2" name="refaddress2" placeholder="Address*" rows="1" class="form-control"></textarea>
    </div>
    </div>
</div>

<div class="row">
<div class="col-md-4">
    <div class="form-group">
<input type="text" id="refemail2" name="refemail2" class="form-control input-sm" placeholder="Email*" required="required">
    </div>
    </div>
 
    <div class="col-md-4">
    <div class="form-group">

<input type="text" id="refmobile2" name="refmobile2" class="form-control input-sm" placeholder="Mob. No*" required="required" maxlength="10" onKeyPress="return isNumberKey(event)">
 
  </div>
    </div>

<div class="col-md-4">
    <div class="form-group">
<input type="text" id="refRelationship2" name="refRelationship2" class="form-control input-sm" placeholder="Relationship*" required="required" onKeyPress="return onlyAlphabets(event,this);">
</div></div></div>

<hr>
<div class="row">
<div class="col-md-12">
<h2 style="color:#fff;">8. Declaration</h2>
</div></div>


<div class="row">
   <div class="col-md-12">
    <div class="form-group" style="color:#fff;">
1. Volunteers are expected to support the vision, mission, values and ethics as specified in the volunteer guide book of Caritas India in delivering of services. <br>
2. Volunteers are expected to participate in training and development opportunities provided by Caritas India. <br>
3. Volunteers are expected not to use their role within the organization to receive preferential treatment when seeking services for themselves, family or friends.<br>
4. Depending upon the need of the organization and nature of involvement of the volunteer, separate agreement will be made with specific terms and conditions. </div></div></div>


        <input type="submit" name="submit" value="Submit" class="btn btn-info btn-block">
    </form>

</div>
<br>

<p style="text-align:justify;"><span style="font-weight:bold;"></span>
</p>

</div>
    </div>
    </div>
    </div>
    </div>


</div>
    </div>
    </div>
    </div>

</body>
<div class="clear"></div>

<?php get_footer(); ?>
=========================================================================
Create Multilanguage website using Polylang Plugin

Step 1- Install plugin

Step 2-  Go to language and create 2nd language (Change language name ex. English->en)

Step 3- Go to language settings and set website url (ex. https://abc.com/en/

Step 4- Set images path src="<?= get_theme_file_uri( 'assets/images/desktop_1600X680.png' ) ?>"

<?= get_theme_file_uri (its take images folder url) ex- https://abc.com/wp-content/themes/abc-theme/
//
src="<?php bloginfo('url'); ?>/wp-content/themes/medela-theme/assets/images/safe.png"

<?php bloginfo('url'); ?>  its take website url ex- https://abc.com/en
//
<img alt="Banner Pattern Desktop" class="banner-pattern-desktop" src="<?= get_theme_file_uri( 'assets/images/desktop_1600X680.png' ) ?>">
<img alt="Banner Pattern Tablet" class="banner-pattern-tablet" src="<?= get_theme_file_uri( 'assets/images/tablet1024x435px.jpeg' ) ?>">
<img alt="Banner Pattern Mobile Mobile" class="banner-pattern-mobile" src="<?= get_theme_file_uri( 'assets/images/mobile767x767px.jpeg' ) ?>">

Step 5- Go to Setting -> Permalinks set https://abc.com/en/%postname%/
Step 6- Put css RTL.CSS under theme folder

======================================================
How to call css & js links in function.php using wp_enqueve_scripts
--------------------------------------
add_action( 'wp_enqueue_scripts', 'add_my_custom_scripts' );
function add_my_custom_scripts() {
    // Enqueue my styles.
    wp_enqueue_style( 'add-bootstrap-style', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' );
     
    // Enqueue my scripts.
    wp_enqueue_script( 'ajax-bootstrap-bundle-script', 'https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js', array(), null, true );
    wp_enqueue_script( 'wpdocs-datatables-bootstrap-script', 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js', array(), null, true );   
}
========================================================
Translate press plugin to create multilanguage website free
=========================================================
HOW TO CREATE CUSTOM TEMPLATE AND GET PAGE AND POST FEATURED IMAGE, TITLE, CONTENT, EXCERPT 

<?php
/*Template Name: Townhall Question*/
get_header();

$loop = new WP_Query( array( 'post_type' => 'page', 'meta_key' => '_thumbnail_id' ) );

$args = array(
    'post_type' => 'page',
    'post_status' => 'publish'
); 
$pages = get_pages($args); 
echo get_the_title();

echo get_the_post_thumbnail( $page->ID, 'full' );
foreach($pages as $page) {
        
}

query_posts(array(
   'post_type' => 'townhallquestion',
   'post_status' => 'publish', 
   'orderby' => 'date', 
   'order' => 'ASC'
)); ?>

<?php
$x=1;

while (have_posts()) : the_post(); ?>

<div class="townhall_main">
<h2 class="townhall_ques"> <span class="townhall_ques_num">Question <?php echo "$x"; ?>: </span> <?php the_title(); ?></h2>
<div class="townhall_desc"><?php the_content(); ?></div>
<p><?php //the_excerpt(); ?></p>
</div>
<?php 
$x++;
endwhile;
get_footer();
?>
*******************************************************************
How to add search bar option in wordpress on custom template
-----------------------------------------------------------
step 1- First Create search form 
      
  <form class="example" method="get">
  <input type="text" placeholder="Search.." name="search" value="<?php echo $_GET['search']; ?>">
  <span><button type="submit" class="search_submit"><i class="fa fa-search"></i></button></span>
  </form>
  
step 2- In custom post type add 's'=>$searchData in array   
  
  $args=array('post_type' => 'healthsafety', 'posts_per_page'=>'10', 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'ASC', 'paged'=>$paged, 's'=>$searchData);
  
step 3- Add some php code
    
     <?php
     /*Template Name: Health Safety*/
     get_header();
    $searchData='';
    if($_GET['search']!=""){
$searchData= $_GET['search'];
    }
    ?>
full code below
---------------------------------
<?php
/*Template Name: Health Safety*/
get_header();

$searchData='';
if($_GET['search']!=""){
$searchData= $_GET['search'];
}
?>
<h4 class="townhall_page_title"> <?php echo get_the_title(); ?></h4>

<div class="searchbox_main">
<!-- The form -->
<form class="example" method="get">
  <input type="text" placeholder="Search.." name="search" value="<?php echo $_GET['search']; ?>">
  <span><button type="submit" class="search_submit"><i class="fa fa-search"></i></button></span>
</form>
</div>
<?php
$x=1;
$args_page = array(
    'post_type' => 'page',
    'post_status' => 'publish'
); 
$pages = get_pages($args_page); ?>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$original_query = $wp_query;
$wp_query = null;
$args=array('post_type' => 'healthsafety', 'posts_per_page'=>'10', 'post_status' => 'publish', 'orderby' => 'date', 'order' => 'ASC', 'paged'=>$paged, 's'=>$searchData);
$wp_query = new WP_Query( $args );
    while (have_posts()) : the_post();  ?>  
<div class="healthsafety_main">
<h2 class="townhall_ques"> <span class="townhall_ques_num99">Document <?php echo "$x"; ?>: </span> <?php the_title(); ?>
<span class="download_file"><?php if( get_field('health_pdf') ): ?>
    <a href="<?php the_field('health_pdf'); ?>" target="_blank"><img src="https://trenttalks.binaryic.co.in/wp-content/uploads/2022/07/download.png"></a>
<?php endif; ?>
</span></h2>
<div class="townhall_desc"><?php //the_content(); ?></div>
<p><?php //the_excerpt(); ?></p>
</div>
<?php
$x++;
endwhile;    
?>  
<span class="next_prev_post"> 
<?php
next_posts_link();
previous_posts_link();
?> 
</span>
<?php
get_footer(); ?>
******************************************************************************
HOW TO GET CURRENT USER NAME, EMAIL, PASSWORD, LOGOUT LINK, PROFILE PIC, ALL DETAILS
https://riptutorial.com/wordpress/example/9022/getting-the-current-user
<?php 
        $current_user = wp_get_current_user();
        echo "Username :".$current_user->user_login;
        echo "Username :".$current_user->ID;
        echo "Username :".$current_user->user_pass;
        echo "Username :".$current_user->user_nicename;
        echo "Username :".$current_user->user_email;
        echo "Username :".$current_user->user_url;
        echo "Username :".$current_user->user_registered;
        echo "Username :".$current_user->user_activation_key;
        echo "Username :".$current_user->user_status;
        echo "Username :".$current_user->display_name;       
    ?>
echo '<a href='. wp_logout_url( home_url() ) .' title="Logout">Logout</a>';
<?php
       global $current_user;
       get_currentuserinfo();     
       echo get_avatar( $current_user->ID, 64 );
   echo get_edit_profile_url( $current_user->ID );
?>
*********************************************************
How to Implement  (call) Ajax with Update query In WordPress
---------------------------------------------------------
<?php
/*Template Name: Edit Profile*/
get_header();
 ?>
<head>
 <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.3/css/bootstrap.min.css'>
 <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css'>
</head>
<section>
    <div class="rt-container">
          <div class="col-rt-12">
              <div class="Scriptcontent">
<div class="student-profile py-4">
  <div class="container">
    <div class="row card shadow-sm">
      <div class="col-lg-12">
        <div class="">
<?php 
$current_user = wp_get_current_user();
//$current_user_id = wp_get_current_user('ID');
     $current_user_id = $current_user->ID;
$dob_str =  get_field('date_of_birth', 'user_'. $current_user->ID );
       $date = DateTime::createFromFormat('d/m/Y', $dob_str);
       $date = $date->format('m/d/Y');
//print_r($current_user);
?>
          <div class="card-header bg-transparent">      
   <?php echo get_avatar( $current_user->ID, 40 ); ?><!-- <img class="profile_img" src="https://source.unsplash.com/600x300/?student" alt="student dp">-->        
<div class="card-body user_info_left">
            <p class="mb-0"><strong class="pr-1"><?php echo $current_user->user_firstname .' '. $current_user->user_lastname; ?> </strong></p>
            <p class="mb-0"><?php the_field('designation', 'user_'. $current_user->ID ); ?></p>
            </div>
            <h4 class="change_image">Change Image</h4>
          </div> 
   </div>
      </div>
  
   <div class="col-lg-12 general_info" id="general_info_id">
        <div class="">
          <div class="card-header bg-transparent border-0">
            <h4 class="mb-0"><b>Personal Details</b> <i onclick="updatePdetails()" class="fa fa-pencil-square-o" aria-hidden="true"></i></h4> 
<!--<a href="<?php //echo home_url(); ?>/update?<?php //echo $current_user->ID; ?>">Update</a>-->
          </div>
          <div class="card-body">
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Full Name</h6></div><div class="col-sm-9 text-secondary"> 
         <?php echo $current_user->user_firstname; echo ' '; echo $current_user->user_lastname; ?>  </div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Date of Birth</h6></div><div class="col-sm-9 text-secondary" id="dis_date_of_birth">
  <?php $date_of_birth = get_field('date_of_birth', 'user_'. $current_user->ID ); echo $date;
?>
</div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Permanent Address</h6></div><div class="col-sm-9 text-secondary" id="dis_permanent_address"> 
  <?php $permanent_address = get_field('permanent_address', 'user_'. $current_user->ID );  
  echo $permanent_address;
  ?>
  </div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Temporary Address</h6></div><div class="col-sm-9 text-secondary" id="dis_temporary_address"> <?php the_field('temporary_address', 'user_'. $current_user->ID ); ?></div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Department</h6></div><div class="col-sm-9 text-secondary" id="dis_department"> <?php the_field('department', 'user_'. $current_user->ID ); ?></div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Designation</h6></div><div class="col-sm-9 text-secondary" id="dis_designation"> <?php the_field('designation', 'user_'. $current_user->ID ); ?></div></div>
  </div>
               
      </div>
  </div> 
  
  <form action="#" method="post" id="perDetailsUpdate">  
      <div class="col-lg-12 general_info">
        <div class="">
          <div class="card-header bg-transparent border-0">
            <h4 class="mb-0"><b>Personal Details</b> <input type="button" onclick="onupdate()" class="update" title="Update" value="Update"/></h4>
          </div>
          <div class="card-body">
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Full Name</h6></div><div class="col-sm-9 text-secondary"> <input type="text" class="form-control" id="ufull_name" value="<?php echo $current_user->user_firstname .' '. $current_user->user_lastname; ?>" > </div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Date of Birth</h6></div><div class="col-sm-9 text-secondary"> <input type="text" class="form-control" id="udate_of_birth" value="<?php echo $date; ?>" > </div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Permanent Address</h6></div><div class="col-sm-9 text-secondary"><input type="text" class="form-control" id="upermanent_address" value="<?php the_field('permanent_address', 'user_'. $current_user->ID ); ?>" > </div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Temporary Address</h6></div><div class="col-sm-9 text-secondary"> <input type="text" class="form-control" id="utemporary_address" value="<?php the_field('temporary_address', 'user_'. $current_user->ID ); ?>" ></div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Department</h6></div><div class="col-sm-9 text-secondary"> <input type="text" class="form-control" id="udepartment" value="<?php the_field('department', 'user_'. $current_user->ID ); ?>" ></div></div>
  <div class="row border-bottom"><div class="col-sm-3"><h6 class="mb-0">Designation</h6></div><div class="col-sm-9 text-secondary"> <input type="text" class="form-control" id="udesignation" value="<?php the_field('designation', 'user_'. $current_user->ID ); ?>" > </div></div>
  </div>
        </div>
      </div>
  </form>
  
    </div>
  </div>
</div>
</div>
</div>
    </div>
</section>

 <script>
 function onupdate(){  
//debugger;
// alert(jQuery("#ufull_name").val());
//console.warn(jQuery("#title33").val());
var formData=[];

   formData.push({
    fullname: jQuery("#ufull_name").val(),
    dateofbirth: jQuery("#udate_of_birth").val(),
            permanentaddress: jQuery("#upermanent_address").val(),
temporaryaddress: jQuery("#utemporary_address").val(),
department: jQuery("#udepartment").val(),
designation: jQuery("#udesignation").val()
        });
   jQuery.ajax({
         type : "post",
         dataType : "json",
         url : "<?php echo admin_url( 'admin-ajax.php' ); ?>",
         data : {action: "my_user_data", alldata:formData},
         success: function(response) {
           //jQuery("#upermanent_address").val(jQuery("#upermanent_address").val());
    jQuery("#dis_date_of_birth").text(jQuery("#udate_of_birth").val());
            jQuery("#dis_permanent_address").text(jQuery("#upermanent_address").val());
jQuery("#dis_temporary_address").text(jQuery("#utemporary_address").val());
jQuery("#dis_department").text(jQuery("#udepartment").val());
jQuery("#dis_designation").text(jQuery("#udesignation").val());
$("#perDetailsUpdate").css("display","none");
             $("#general_info_id").css("display","block");
         }
      });
 }
 </script>
   <script>
function updatePdetails() {
$("#general_info_id").css("display","none");
         $("#perDetailsUpdate").css("display","block");
}
  </script>
<?php
get_footer();
?>
-------------------------------------function.php-----------------------
add_action("wp_ajax_my_user_data", "my_user_data");
add_action("wp_ajax_nopriv_my_user_data", "my_user_data");

function my_user_data() {
$user_id=get_current_user_id();  
$postData=$_POST['alldata'][0];
 
//update_user_meta( $user_id, 'first_name', $postData['fullname'] );
update_user_meta( $user_id, 'date_of_birth',$postData['dateofbirth'] );
update_user_meta( $user_id, 'permanent_address',$postData['permanentaddress'] ); 
update_user_meta( $user_id, 'temporary_address',$postData['temporaryaddress'] );
update_user_meta( $user_id, 'department',$postData['department'] );
update_user_meta( $user_id, 'designation',$postData['designation'] );
echo  json_encode(array("success"=>1));
 die();
}
************************************
redirect users without logged in to login page 
Here is the function to redirect non-users to login page. add code in function.php
function redirect_user() {
  if ( ! is_user_logged_in() && ! is_page( 'login' ) ) {
    $return_url = esc_url( home_url( '/login/' ) );
    wp_redirect( $return_url );
    exit;
  }
}
add_action( 'template_redirect', 'redirect_user' );
****************************************************
 Set Time Out function
 --------------------------------
 setTimeout(function(){
    //code put here
   }, 01);
*****************************************
Update profile picture in frontend ----------------------------------------------------- <?php $user_id = get_current_user_id(); $user = get_userdata($user_id); if($user != false): $user_type = get_usermeta($user_id, 'type'); $profile_img = get_usermeta($user_id, 'user_profile_img_url'); $profile_img = get_usermeta($user_id, 'user_profile_picture_custom', true); $profile_img = ($profile_img) ? $profile_img : site_url()."/wp-content/uploads/avatars/abc/".strtolower(substr($current_user->user_firstname,0,1)).".png"; // echo $profile_img = get_usermeta($user_id, 'user_profile_img_path'); ?> <div class="card-header bg-transparent" id="user_image_display"> <?php if($profile_img != ''){ ?> <img src="<?=$profile_img?>" alt="profile_pic" class="avatar avatar-40 photo" id="dis_profileimg"> <?php } ?> <?php //echo get_avatar( $current_user->ID, 40 ); ?><!-- <img class="profile_img" src="https://source.unsplash.com/600x300/?student" alt="student dp">--> <div class="card-body user_info_left"> <p class="mb-0"><strong class="pr-1"><?php echo $current_user->user_firstname; ?> </strong></p> <p class="mb-0"><?=$designation?></p> </div> <h4 class="change_image"><div class="change_imaged" onclick="updateImage()"> Change Image </div></h4> <form action="<?php echo admin_url( 'admin-ajax.php' ); ?>?action=save_user_profile_picture" method="post" id="imageform" enctype="multipart/form-data"> <div class="col-lg-12"> <div class=""> <div class="card-header bg-transparent"> <img src="<?php echo esc_attr( get_the_author_meta( 'user_profile_picture_custom', $user->ID ) ); ?>" alt="profile_pic" class="avatar avatar-40 photo" id="dis_profileimgedit"> <div class="card-body user_info_left"> <p class="mb-0"><strong class="pr-1"><?php echo $current_user->user_firstname; ?> </strong></p> <p class="mb-0"><?php the_field('designation', 'user_'. $current_user->ID ); ?></p> </div> <h4 class="change_image"> <input type="submit" onclick="updateCurrentimage()" name="updateimage" id="update" value="Update" class="editcurrentimage"> </h4> Profile Image: <input type="file" name="user_img" id="user-img" /></br> <input type="hidden" name="user_id" value="<?php echo $user_id;?>"> </div> </div> </div> </form> <?php endif; // if user ends - if($user != false): ?> <script> function updateImage() { $("#user_image_display").css("display", "none"); $("#imageform").css("display", "block"); }; function updateCurrentimage() { //$("#user_image_display").css("display", "block"); //$("#imageform").css("display", "none"); }; jQuery(document).ready(function (e) { jQuery("#imageform").on('submit',(function(e) { e.preventDefault(); jQuery.ajax({ url: "<?php echo admin_url( 'admin-ajax.php' ); ?>?action=save_user_profile_picture", type: "POST", data: new FormData(this), contentType: false, cache: false, processData:false, success: function(data) { $("#dis_profileimg").attr("src",data); //$("#dis_profileimgedit").attr("src",data); setTimeout(function(){ $("#dis_profileimgedit").attr("src",data); }, 01); $("#user-img").val(null); $("#user_image_display").css("display", "block"); $("#imageform").css("display", "none"); }, }); })); }); </script> -----------------------function.php---------------- add_action( "wp_ajax_save_user_profile_picture", "save_user_profile_picture" ); add_action( "wp_ajax_nopriv_save_user_profile_picture", "save_user_profile_picture" ); function save_user_profile_picture() { $user_id = esc_sql($_POST['user_id']); $fname = esc_sql($_POST['user_fname']); $lname = esc_sql($_POST['user_lname']); if($_FILES['user_img']['error'] == 0 ){ $file = $_FILES['user_img']; $ext = explode('/', $file['type'])[1]; $file_name = "$user_id.$ext"; // 5.png if(!metadata_exists('user', $user_id, 'user_profile_img_url')){ $image = wp_upload_bits($file_name, null, file_get_contents($file['tmp_name'])); add_user_meta($user_id, 'user_profile_img_url', $image['url']); add_user_meta($user_id, 'user_profile_img_path', esc_sql($image['file'])); }else{ $profile_img_path = get_usermeta($user_id, 'user_profile_img_path'); //wp_delete_file($profile_img_path); $image = wp_upload_bits($file_name, null, file_get_contents($file['tmp_name'])); update_user_meta($user_id, 'user_profile_img_url', $image['url']); update_user_meta($user_id, 'user_profile_img_path', esc_sql($image['file'])); } update_user_meta($user_id, 'user_profile_picture_custom', $image['url']); } $userdata = array( 'ID' => $user_id, 'first_name' => $fname, 'last_name' => $lname, ); $user = wp_update_user($userdata); if(is_wp_error($user)){ echo 'Can not update : '.$user->get_error_message(); } $profile_img_url = get_usermeta($user_id, 'user_profile_img_url'); echo $profile_img_url; die(); } ************************************************************************** /*------------------------------User Profile Field Start------------------------------*/ add_action( 'show_user_profile', 'extra_user_profile_fields' ); add_action( 'edit_user_profile', 'extra_user_profile_fields' ); function extra_user_profile_fields( $user ) { ?> <h3><?php _e("Extra profile information", "blank"); ?></h3> <table class="form-table"> <tr> <th><label for="user_profile_picture_custom">Employee Profile Picture</label></th> <td> <div class="uploadbut-block"> <input type="button" name="user_profile_picture_custom" class="medium" id="user_profile_picture_custom" value="User Profile Picture"><br> <img src="<?php echo esc_attr( get_the_author_meta( 'user_profile_picture_custom', $user->ID ) ); ?>" id="getImage" style="width: 250px; height:200px;padding: 10px 0px;"> <input type="hidden" name="user_profile_picture_custom" class="medium" id="getImage1" value="<?php echo esc_attr( get_the_author_meta( 'user_profile_picture_custom', $user->ID ) ); ?>"> <!-- <div class="suggestion_detail" style="padding:5px 0;color:red;"><b>**NOTE:</b> Please upload 220*200 size of Image.</div> --> </div> </td> </tr> <tr> <th><label for="date_of_birth"><?php _e("Date Of Birth"); ?></label></th> <td> <input type="date" name="date_of_birth" id="date_of_birth" value="<?php echo esc_attr( get_the_author_meta( 'date_of_birth', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> <tr> <th><label for="department"><?php _e("Department"); ?></label></th> <td> <?php $department = esc_attr( get_the_author_meta( 'department', $user->ID ) ); ?> <input type="text" name="department" id="department" value="<?=$department?>"> <?php if(false): ?> <select name="department" id="department"> <option value="">Department</option> <option value="Marketing" <?php if($department=='Marketing') { echo'selected'; } ?> >Marketing</option> <option value="HR" <?php if($department=='HR'){ echo'selected'; } ?>>HR</option> <option value="Design" <?php if($department=='Design') { echo'selected'; } ?>>Design</option> </select> <?php endif; ?> </td> </tr> <tr> <th><label for="emp_code"><?php _e("Employee Code"); ?></label></th> <td> <?php $emp_code = esc_attr( get_the_author_meta( 'emp_code', $user->ID ) ); ?> <input type="text" name="emp_code" id="emp_code" value="<?=$emp_code?>"> </td> </tr> <tr> <th><label for="Joining_date"><?php _e("Joining Date"); ?></label></th> <td> <input type="date" name="joining_date" id="joining_date" value="<?php echo esc_attr( get_the_author_meta( 'joining_date', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> <tr> <th><label for="mobile_no"><?php _e("Contact Number"); ?></label></th> <td> <input type="text" name="mobile_no" id="mobile_no" value="<?php echo esc_attr( get_the_author_meta( 'mobile_no', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> <tr> <th><label for="permanent_address"><?php _e("Permanent Address"); ?></label></th> <td> <input type="text" name="permanent_address" id="permanent_address" value="<?php echo esc_attr( get_the_author_meta( 'permanent_address', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> <tr> <th><label for="temporary_address"><?php _e("Temporary Address"); ?></label></th> <td> <input type="text" name="temporary_address" id="temporary_address" value="<?php echo esc_attr( get_the_author_meta( 'temporary_address', $user->ID ) ); ?>" class="regular-text" /><br /> </td> </tr> <tr> <th><label for="emp_designation"><?php _e("Designation"); ?></label></th> <td> <?php $designation = esc_attr( get_the_author_meta( 'emp_designation', $user->ID ) ); ?> <input type="text" name="emp_designation" id="emp_designation" value="<?=$designation?>"> <?php if(false): ?> <select name="emp_designation" id="emp_designation"> <option value="">Designation</option> <option value="Director" <?php if($designation == 'Director') { echo'selected';} ?> >Director</option> <option value="Developer" <?php if($designation == 'Developer'){ echo'Developer';} ?>>Developer</option> <option value="Designer" <?php if($designation == 'Designer') { echo'selected';} ?>>Designer</option> <option value="Tester" <?= ($designation =='Tester') ? 'selected':''?> >Tester</option> </select> <?php endif; ?> </td> </tr> </table> <?php } add_action( 'personal_options_update', 'save_extra_user_profile_fields' ); add_action( 'edit_user_profile_update', 'save_extra_user_profile_fields' ); function save_extra_user_profile_fields( $user_id ) { if ( empty( $_POST['_wpnonce'] ) || ! wp_verify_nonce( $_POST['_wpnonce'], 'update-user_' . $user_id ) ) { return; } if ( !current_user_can( 'edit_user', $user_id ) ) { return false; } update_user_meta( $user_id, 'department', $_POST['department'] ); update_user_meta( $user_id, 'emp_code', $_POST['emp_code'] ); update_user_meta( $user_id, 'joining_date', $_POST['joining_date'] ); update_user_meta( $user_id, 'emp_designation', $_POST['emp_designation'] ); update_user_meta( $user_id, 'user_profile_picture_custom', $_POST['user_profile_picture_custom'] ); update_user_meta( $user_id, 'date_of_birth', $_POST['date_of_birth'] ); update_user_meta( $user_id, 'mobile_no', $_POST['mobile_no'] ); update_user_meta( $user_id, 'permanent_address',$_POST['permanent_address'] ); update_user_meta( $user_id, 'temporary_address',$_POST['temporary_address'] ); } /*------------------------------User Profile Field End--------------------------------*/ *************************************************************************************    
ADD COOKIES ACCEPT & CLOSE (PLUGIN AND CUSTOM)
--------------------------------------------------------------------------------
https://youtu.be/lhlbLC8Fd7M
COOKIE CONSENT PLUGIN

GDPR Cookie Consent banner

==============================================    
Fatal error: Declaration of NTN_Walker_Nav::start_el(&$output, $item, $depth, $args) must be compatible with Walker_Nav_Menu::start_el(&$output, $item, $depth = 0, $args = null, $id = 0) in H:\xampp\htdocs\wp\abc\wp-content\themes\test-theme\inc\class-extends.php on line 14

function start_el(&$output, $item, $depth, $args){
change this line to this
function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
---------------------------------------------------------------------

how to know the website is made which technology (Built with)

https://www.wappalyzer.com/
https://builtwith.com/
https://w3techs.com/
***************************************************************

UPLOAD WEBSITE IN C PANEL

******************************************************************
domainname/cpanel  put in browser
 and follow steps
I Understand the Risks->Add Exception->location(not change) open cpanel
-----------------------
mysqldatabase wizard -> create database labourlaw ->next step ->Step 2: Create Database Users:
Username:
Password:
Password (Again):
-> create user ->all privilege ->next ->return to home
-------------------------------------------------------------------
click phpmy admin and check databse maximum 2
and click database make you(labour) and export database localhost open in dreamwear change
path[http://localhost/networldpoint/cms/wordpress/riseagain REPLACE THIS http://beurexbird.com/labour/] replace all and save and  import database ->browse -> go
msg import success [note: when import wrong database means path name not replace then click database -> structure -> check all -> with selected:Drop]
----------------------------------------------------------------------
then go Cpanel->File manager->make(click) new folder->create ->then create folder (hootsup)->(upload here)only upload Zip File ->Then First Zip file when you want to upload ->then go Upload ->then upload successfully-> Browse ->Browse success ->back to upload file right click compressed file(extract it) ->back one step
-------------------------------------
go mysqldatabase wizard  copy 

database name: beurexbi_labourlaw
user name: beurexbi_labour

and changes wp-config.php = /** The name of the database for WordPress */
define('DB_NAME', 'beurexbi_labourlaw');

/** MySQL database username */
define('DB_USER', 'beurexbi_labour');

/** MySQL database password */
define('DB_PASSWORD', 's@vz5a3+123wk');
--------------------------------------------------------------------
when one folder in then select all ->move file ->http://beurexbird.com/labour/(remove labour as you want to move file)
********************************************************************
Duplicator Plugin
http://www.wpbeginner.com/wp-tutorials/how-to-move-live-wordpress-site-to-local-server/
*****************************************************
HOW TO ADD POPUP JQUERY CLICK DIV
*********************************************
        <div style="position: absolute; min-width: 100px; min-height: 30px; padding-top: 5px; border: 0px solid red; right: 0px; top: 5px; border-top-left-radius: 10px; border-bottom-left-radius: 10px; background: linear-gradient(to bottom, rgb(224, 243, 250) 0%, rgb(216, 240, 252) 35%, rgb(184, 226, 246) 52%, rgb(182, 223, 253) 100%) repeat scroll 0px 0px transparent;">
<strong style="color: rgb(136, 119, 136); margin-top: 5px;">
<a style="color:#005421;" onclick="document.getElementById('popcon').style.display='block';document.getElementById('fade').style.display='block'" href="javascript:void(0)">Feedback</a></strong>
        </div>
    
<div id="popcon" class="white_content" style="display:none;">
    <h3 style="color:#6C7;">
<u>Give Your Feedback</u>
</h3>  
            <p style="position:absolute; right:10px; top:10px;">
<a onclick="document.getElementById('popcon').style.display='none';document.getElementById('fade').style.display='none'" href="javascript:void(0)">Close</a>
</p>
     <?php echo do_shortcode('[contact-form-7 id="37" title="Contact form 1"]'); ?>
       </div>
   
          <div class="black_overlay" id="fade" style="display: none;"></div>  
-----------------------
CSS
---------
.white_content {
  background-color: white;
  border: 16px solid #98d040;
  display: none;
  height: auto;
  left: 32%;
  min-height: 60%;
  overflow: auto;
  padding: 16px;
  position: absolute;
  top: 13%;
  width: 30%;
  z-index: 1002;
}
.black_overlay {
  background-color: #ddf;
  display: none;
  height: 100%;
  left: 0;
  opacity: 0.8;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1001;

}
******************************************************************
How to call widget any page or post
-----------------------------------------------
widget-shortcode

**************************************************************************
How to call img title and alt tag
-----------------------------------------------
wp-image-seo 
*******************************
how to add dynamic class in body
**********************
go header.php and write this
 <body <?php body_class(); ?>>

HOW TO REDIRECT OLD WP WEBSITE DOMAIN TO ANOTHER WEBSITE DOMAIN (only change main domain)
-------------------------------------------
#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ https://abcd.com/$1 [R=301,L]

This code PUT TOP ON .htaccess FILE as full code

#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ https://abc.sg/$1 [R=301,L]

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /wp/test/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/medelatest/index.php [L]
</IfModule>

# END WordPress
------------------------------------------------------
header("Location: https://abc.sg/");

if (strpos($_SERVER['REQUEST_URI'], "why-us") !== false){
header("Location: https://abc.sg/why-us");
//die();
}

if (strpos($_SERVER['REQUEST_URI'], "about") !== false){
header("Location: https://abc.sg/about");
}

*********************************************************************
Important Link
***********************************************************************
http://teamtreehouse.com/
http://www.codecademy.com/
http://wordpress.org/plugins/widgets-on-pages/
http://wordpress.org/plugins/ultimate-posts-widget/screenshots/
https://www.studentstutorial.com/ajax
codeigniter
https://www.youtube.com/watch?v=GcRv-3-pXeI&list=PL_HlKez9XCSM6WNO_dHhF3yPKVdY1ZZzB

https://www.youtube.com/c/TechnicalSunejaji
*********************************************************************
WP TESTING PLUGIN IN WORDPRESS
*********************************************************************
1. wp-job manager
2. login with ajax
3. sexy login
4. paypal plugin
5. WordPress Thumbnail Slider
6.Custom Logo
*******************************************************************
1. http://www.osrgroup.org/
2. http://www.sewiedevelopers.com
3. http://www.versatileindia.in/
4. http://www.vscitydevelopers.com/
5. http://www.pratapcandc.com/
6. http://www.kamakhyainfra.in/
*******************************************************************
1. http://ampleleap.com/
2. anantashram.co.in
3. kanpuruniversity.co
4. http://infoparktech.org/
5. http://isoalphatech.org/
6. http://neuralinfo.in
7. http://paramhansa.org/
8. http://sidguru.com/
9. http://drskgulati.com/
***********************************************************
HOW TO SET DYNAMIC ID PAGE OR POST OR ANYWHERE
page_id_<?php echo $post->ID; ?>
***********************************************************
Live Chat http://webhostingworld.net/
************************REFRENCES SITE***************
http://vscitydevelopers.com/gallery.aspx
http://mmicindia.com/home.aspx
http://www.gomtiestate.com/

slick contact form
===========================================
http://www.designchemical.com/blog/index.php/wordpress-tips/wordpress-tutorial-adding-a-widget-area-to-your-theme-files/

http://www.bccfalna.com/using-wordpress-themes/?utm_source=feedburner&utm_medium=email&utm_campaign=Feed%3A+BccFalnaWebSolutions+%28BccFalna.com+%3A+TechTalks+in+Hindi%29

*************************************************************

////WORDPRESS CUSTOM THEME DEVELOPMENT////

*************************************************************
WS CUBETECH = https://www.youtube.com/watch?v=wIFQabTDZ70&list=PLjVLYmrlmjGc_A9H4NSLEHaD8kSz9Q38g

https://www.youtube.com/watch?v=-6q3Rt1MTtk&list=PLjVLYmrlmjGcXDYZC67Us13PBD-3us9jB

Required Files create Custom WordPress Themes
step 1- Create a folder (ABC or any name) and put under below files
1- style.css        // here define Theme Name, Description, Author Name, author uri, version..etc.
2- index.php        // front page
3- comments.php
4- screenshot.png   // shows theme design image
5- page.php         // default page
6- header.php
7- footer.php
8- functions.php

Step 2- Go to HTML Template you want to convert on wordpress
Step 3- Copy index.html file content and paste under wp theme folder-> index.php file
Step 4- And now call css, js, images using wp predifned functions-
     1- echo get_template_directory_uri();
  2- bloginfo('template_directory');
 
 <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style.css">
Step 5- cut header and paste in header.php file and call header.php in under index.php using this function <?php get_header(); ?>  
Step 6- If website have multiple header, means inner pages use diffrent header known as header-inner.php then call header-inner.php
  in under index.php using this function <?php get_header('inner'); ?>
Step 7- cut footer and paste in footer.php file and call footer.php in under index.php using this function <?php get_footer(); ?>  
Step 8- If website have multiple footer, means inner pages use diffrent footer known as footer-inner.php then call footer-inner.php
in under index.php using this function <?php get_footer('inner'); ?> 
Step 9- To register a navigation menu in WordPress these two functions should be used:
register_nav_menus()  // it's uses to show Menu option under Appearance in wp admin panel
wp_nav_menu()         // it's uses show menu in frontend
put code under ---------------functions.php--------------------
// it's uses to show Menu option under Appearance in wp admin panel
<?php
    register_nav_menus(
             array('primary-menu'=>'Top Menu')  or array('primary-menu'=>'Top Menu'),array('secondary-menu'=>'Footer Menu')
);
?>
---------------end functions.php--------------------
and show in frontend (index.php)
<div class="menu_bar">
<?php wp_nav_menu( array('theme_location'=>'primary-menu','menu_class'=>'nav')) ?>
</div>
step 10-  ---------------page.php (default page)(it's use all pages)-------  <?php get_header(); ?>
the_post(); (wordpress har cheese ko as a post read kerta hai)
get dynamic page title: <h1> <?php the_title() ?> </h1>
Breadcrumb: <h2> <a href="<?php echo site_url() ?> <i> Home /</i> <?php the_title() ?></h2>
get dynamic page content: <h1> <?php the_content() ?> </h1>  or  <?php echo get_the_content() ?> 
<?php get_footer(); ?>
Step 11- How to create thumbnail image option in admin
The function that you need for enabling WordPress featured images is:
put code under ---------------functions.php--------------------
// It's uses to show Featured image upload option in wp admin panel
<?php
add_theme_support('post-thumbnails');
?>
---------------end functions.php--------------------
and show in frontend (page.php)
<?php the_post_thumbnail(); ?>
<?php the_post_thumbnail('medium'); ?>
<?php the_post_thumbnail('full'); ?>
<?php the_post_thumbnail(array(500,500)); ?>
get image path or any attachment path
$imagepath = wp_get_attachment_image_src(get_post_thumbnail_id(),'large');
//print_r($imagepath);
<img src="<?php echo $imagepath[0]; ?>" width="500">
Step 12- How to Insert Logo on a Header in WordPress, The function that is used to upload a logo is
put code under ---------------functions.php--------------------
      <?php  
  add_theme_support(custom_header);    // it's uses to show custom header option under Appearance in wp admin panel (add logo here)
  ?>
---------------end functions.php--------------------
and show in frontend (page.php)
<?php  $logoimg= get_header_image(); ?>
<img src="<?php echo $logoimg; ?>" class="logo">
*****************************************************************
How to Create Template (use for diffrent or seprate page design)
-------------------------------template-contact.php-------------
<?php
/*
 // Template Name: Contact
*/
get_header(); 
?>
<?php echo get_template_directory_uri();  ?> //call images path
// put here contact custom page content
<?php 
get_footer(); ?>
 **********************************************************
How to Display post in wordpress (index.php page bydefault blog page)
-----------------------------------------------------------------------
  have_post() // this function works on only index.php page
  the_post()  // this use for counting no. of posts 
  <?php
  while(have_post()) {
  the_post()
  ?>
  //put code here  <h2>  <?php the_title(); ?></h2>
  // the_excerpt();  // display short description
  // echo get_the_date(); or the_date(); // display date
  <?php  } ?>
 *****************************************************
How to Add Pagination Option in Post Page
-----------------------------------------------------------------------
Step 1- Using wp pagenavi wordpress plugin (install plugin)
Step 2- Put this function where you want to display  <?php echo wp_pagenavi(); ?>
Step 3- Call this function in header.php  <?php wp_head(); ?> // this function call all plugins related css
Step 4- Call this function in footer.php  <?php wp_footer(); ?> // this function call all plugins related Java Script

**************************************************************
How to Display post detail page (means single post) in wordpress (single.php blog single  page)
-----------------------------------single.php----------------
  <a href="<?php the_permalink(); ?>"> <input type="button" value="read More" name="btn"> </a>
  <?php
get_header(); 
the_post(); // use when not display author name, date etc..
?>

// put here contact custom page content
   <?php the_title(); ?>  // show title
   <?php the_content(); ?>  // show full content
   <?php the_except(); ?>  // display short description
   <?php echo get_the_date(); or the_date(); ?> // display date
 <?php echo get_the_author(); ?>  // show author name
  <?php comment_form(); ?>  // show comment form
  <?php wp_comment_list(); ?>  // show comment list

<?php 
get_footer();
 ?>
*********************************************************
How to Display Comments Lists in single post detail page (means single post) in wordpress
-----------------------------------single.php------------
<?php comments_template(); ?>  // this function show comment form and list both
******************************************************************
How to Display post according to category wise on custom wordpress theme
-----------------------------------category.php------------------
 have_post() // this function works on only index.php page
  the_post()  // this use for counting no. of posts 
  <?php
  while(have_post()) {
  the_post()
  ?>
  //put code here  <h2>  <?php the_title(); ?></h2>
  // the_except();  // display short description
  // echo get_the_date(); or the_date(); // display date
  //
  <?php } ?>
********************************************************
How to add Dynamic Widget Readdy sidebar on wordpress
put code under ---------------functions.php--------------------
<?php register_sidebar(
  array(
      'name'=>"Sidebar Location",
  'id'=>'sidebar_id'
  )
);  
// It's uses to show widget option in wp admin panel under appearance
?>
---------------end functions.php--------------------
and show in frontend (index.php)
<?php  dynamic_sidebar('sidebar_id'); ?>
******************************************************************
How to Add Sidebar File in Wordpress
-----------------------------------------------------------------------
first create sidebar.php file and put sidebar content here
and show in frontend (index.php) <?php  get_sidebar(); ?>
******************************************************************
How to Create Dynamic page title in Wordpress
-----------------------------------------------------------------------
  <?php wp_title(); ?>                 // page title show in top here url
  <?php bloginfo('name'); ?>           // site title
  <?php bloginfo('description'); ?>    // site description (tagline)
  <?php wp_head(); ?>                // it's called  all plugin related css
  <?php wp_footer(); ?>                // it's called all plugin related js
  <?php if(is_front_page()) {  //put here display only home page  }
******************************************************************
How to add custom background title in Wordpress
put code under ---------------functions.php---------------------
 <?php add_theme_support('custom-background'); ?>   
---------------end functions.php--------------------
 and show in frontend (header.php)
<head> <?php wp_head(); ?> </head>
<body <?php body_class(); ?> >
******************************************************************
 Create an Error 404 Page in WordPress Theme 
----------------------------404.php---------------------
 <?php
get_header(); 
?>
<div class="pagenot"> Error 404 </div>  //style    .pagenot{font-size:40px;padding:40px 0px;text-align:center;}
  <?php
get_footer(); 
?>

******************************************************************
How to use get_categories() function in Wordpress (category or taxonomy or term) are smilar word

--------------------show categories in home page---------------------
        <?php
          get_header(); 
  $cat= get_categories(array('taxonomy'=>'category'));
  echo "<pre>";   // ye object me data deta hai // array kis format me hai 
    print_r($cat);    // kya kya data pada hai ye dikhata hai
   echo "</pre>";
?>
 <?php foreach($cat as $catvalue) { ?>
<a href="<?php echo get_category_link($catvalue->term_id); ?>"> <h3> <?php echo $catvalue->name; ?> <?php echo $catvalue->count; ?></h3> </a>
<?php } ?>
*************************************************************************
  How to Add to add excerpt (Short description) in WordPress 
  
  put code under ---------------functions.php---------------------
    <?php add_post_type_support('page', 'excerpt'); ?>   //Show Short description option under page in admin
<?php add_post_type_support('page', 'excerpt'); ?>   //Show Short description option under post in admin
---------------end functions.php----------------------------------
 show in frontend
 <?php the_excerpt(); ?>
 
**********************************************************************
How to Create Custom Post Type in WordPress (same as page and post)
--------------------------------------------------------------
 use (Custom Post Type Maker Plugin)
 
How to use Wp_query in WordPress when create Custom Post Type
--------------------------------------------------------------
 all post, custom post type data store in Wp_post table in Database
 and field name (post_type) here shows post type name page, post or news ...etc.  

<?php get_header(); ?>
   
 <?php $wpnew= array( 'post_type'=>'news',
'post_status'=>'publish'
);
$newsquery= new Wp_Query($wpnew);    //Wp_Query it's return post type data
while($newsquery->have_posts()) {
$newsquery->the_post();
 ?>
// put here code 
<?php the_title(); ?>  // show title
   <?php the_content(); ?>  // show full content
   <?php the_except(); ?>  // display short description
   <?php echo get_the_date(); or the_date(); ?> // display date
  <?php echo get_the_author(); ?>  // show author name
  <?php comment_form(); ?>  // show comment form
  <?php wp_comment_list(); ?>  // show comment list
 
<?php }  ?>
****************************************
How to Create Custom Taxonomy (Category) in WordPress

****************************************
How to Get Custom Taxonomy (Category) in WordPress
using get_terms() function

<?php get_header(); 
$newsCat= get_terms(['taxonomy'=>'news_category', 'hide_empty'=>'false']));
echo "<pre>";     // ye object me data deta hai // array kis format me hai 
     print_r($newsCat);    // kya kya data pada hai ye dikhata hai
  echo "</pre>"; ?>
   
 <?php foreach($newsCat as $newsCatData) { ?>
<h3> <?php echo $newsCatData->name; ?> </h3> 
<?php }  ?>
******************************************************************
How to create custom taxonomy in WordPress
->using get_terms() function

How to get custom taxonomy using get_terms() function
->$newsCat= get_terms(['taxonomy'=>'news_category', 'hide_empty'=>'false','orderby'=>'name','order'=>'DESC']);

How to add limit and order by in custom taxonomy
->$newsCat= get_terms(['taxonomy'=>'news_category', 'hide_empty'=>'false','orderby'=>'name','order'=>'DESC','number'=>1]);

How to add and display image option in custom taxonomy in WordPress
-> add plugin Category and Taxonomy image

How to create a custom taxonomy template in WordPress
-> taxonomy-news_category.php    //news_category this is taxonomy(category) name
----------------------------------

<?php get_header(); 
     $catDeta=get_queried_object();   // this function return jis category per click kiya h, give full details;
print_r($catDeta);
?>
 <h3> <?php echo $catDeta->name; ?> </h3>  
  
<?php
$wpnew= array(
'post_type'=>'news',
'post_status'=>'publish',
'tax_query'=>array(
array(    'taxonomy'=>'news_category',
'field'=>'term_id',
'terms'=>$catDeta->term_id
)
),
);
$newsquery= new Wp_Query($wpnew);    //Wp_Query it's return post type data
while($newsquery->have_posts()) {
$newsquery->the_post();
?>    
<?php get_footer(); ?>
----------------------------------------------------    
get_queried_object() function
How to get parent category in WordPress  
$newsCat= get_terms(['taxonomy'=>'news_category', 'hide_empty'=>'false','orderby'=>'name','order'=>'DESC','parent'=>0]);
**************************************************
How to Create Custom Field and Repeater Option in WordPress
-----------------------------------------------------
First install 2 plugins
1- Advanced custom field
2- Advanced custom field Repeater field
----------------------------------------
step 1- Install & activate Advanced custom field
step 2- go to Dashboard->Custom fields-> add new-> Put Title (Contact Details)
step 3- add field-> Enter Field label= Phone number,  Enter Field name= phone_number1, and select input type=text
 when need more field same as add field
step 3- Location -> Show this field(Page or Post...etc) -> is equal to -> (page name)contact us
custom field created in contact us page
step 4- below go Settings-> Style (Standard) and Position (Side)

and fetch(get) custom field -> go to template page and paste below
 <?php the_field('Field name','Page ID'); ?>
 <?php the_field('phone_number1',32); ?>
-----------------------------------------------
 2- Advanced custom field Repeater field
-----------------------------------------------
step 1- Install & activate 2- Advanced custom field Repeater field
step 2- go to Dashboard->Custom fields-> add new-> Put Title (Contact Details)
step 3- add field-> Enter Field label= Phone number,  Enter Field name= phone_number1 and select input type=repeater
        and create sub field
step 3- Location -> Show this field(Page or Post...etc) -> is equal to -> (page name)contact us
        custom field created in contact us page
step 4- below go Settings-> Style (Standard) and Position (Side)

and fetch(get) custom field -> go to template page and paste below
<?php

// Check rows existexists.
if( have_rows('repeater_field_name',page_id )) {
    // repeater_field_name main->field name
    // Loop through rows.
    while( have_rows('repeater_field_name',page_id) ) { 
       the_row(); 
       ?>   
        // Load sub field value.
        $sub_value = get_sub_field('sub_field');
        // Do something...
Get Title-> <h1> <?php echo get_sub_field('course_name',32); the_sub_field('course_name',32); ?></h1>
Get Image-> <div class="icon1"> <img src="<?php echo get_sub_field('course_image',32); the_sub_field('course_image',32); ?>"> </div>
<?php } }  ?>
-----------------------------------------------
How to Searching and Pagination using Wp-query
-----------------------------------------------
wp_pagenavi()
get_query_var()
s=’postTitle’
---------------template-news.php--------------------
<?php get_header(); 

  echo $paged= get_query_var('paged') ? get_query_var('paged') : 1;
   
        $searchData='';
if($_GET['title']!="") {
   $searchData=$_GET['title'];
}
         ?>
   
 <form method="get">
<input type="text" placeholder="Search by Name" name="title" value="<?php echo $_GET['title']; ?>">

<input type="submit" value="Search" name="">   
</form>    
   
<?php
$wpnew= array(
'post_type'=>'news',
'post_status'=>'publish',
's'=>$searchData,
'post_per_page'=>1,
'paged'=>$paged
);
$newsquery= new Wp_Query($wpnew);    //Wp_Query it's return post type data
while($newsquery->have_posts()) {
$newsquery->the_post();
?>
<?php } ?>

<?php echo wp_pagenavi(array('query'=>$newsquery)); ?>
***********************************************************************
Learn to Insert and Taxonomy Form Website in WordPress
------------------------------------------------------------
    <?php
          get_header(); 
  if(isset($_POST['savenews'])){
   $id= wp_insert_post(
   array(
         'post_type'=>'news',       //news cpt already created in dashboard
         'post_status'=>'draft',
'post_title'=>$_POST['ntitle'],
'post_content'=>$_POST['ndes']
   )
   );
   
wp_set_object_terms($id, $_POST['newscat'], 'news_category');
  }?>
       <form method="post" class="formData">
   <div> News Title </div>
   <div> <input type="text" name="ntitle"></div>
   
   <div> News Sescription </div>
   <div> <textarea name="ndes">  </textarea>
   
<select name="newscat">
 <option> Select news category</option>
$newsCat=get_terms(['taxonomy'=>'news_category', 'hide_empty'=>'false'
   ,'orderby'=>'name','order'=>'DESC','parent'=>0]); 
  ?>
    <?php
foreach($newsCat as $newsCatData) {
?>
 
<option value="<?php echo $newsCatData->name; ?>"> <?php echo $newsCatData->name; ?> </option> 
<?php
}
             ?>
   </select>
   
   <button name="savenews"> Save News </button>
   </div>

       </form>  
*************************************************************
Rest API in WordPress
------------------------------------------
End Point- http://localhost/your_project/wp-json/myapi/v1/test
Result 
Here you can do anything!
--------------------------------
add_action('rest_api_init', function() {
register_rest_route('myapi/v1', 'test', [
'methods' => 'GET',
'callback' => 'my_first_api',
]); 
   
});

function my_first_api(){
    echo 'Here you can do anything!';
}
-------------------------------------
method POST bhi ho sakata hai
Route ka matlab kya url likhana hia
myapi/v1 - ye tumm kuchh bhi likh sakate ho
my_first_api - ye function hai
jisme code likhate hia

http://yourdomain.com/wp-json/wp/v2/posts
wp - custom likh lo
v2 - ye version hai kuchh bhi likh

*****************************************************
WordPress Custom Ajax Form
-------------------------------------
create template page-contact-us.php

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script>

<form id="frmContactUs" methos="post">
    <table>
        <tr>
            <td>Name</td>
  <td><input type="text" name="name" required/></td>
        </tr>
        <tr>
            <td>Email</td>
            <td><input type="email" name="email" required/></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" id="submit" name="submit"/></td>
        </tr>
    </table>
    <div id="result_msg">

    </div>
</form>
<style>
#frmContactUs table td{border:0px;}
#frmContactUs .false{color:red;}    
#frmContactUs .true{color:green;}    
</style>
<script>
jQuery('#frmContactUs').submit(function(){
    event.preventDefault();
    jQuery('#result_msg').html('');
    var link="<?php echo admin_url('admin-ajax.php')?>";
    var form=jQuery('#frmContactUs').serialize();
    var formData=new FormData;
    formData.append('action','contact_us');
    formData.append('contact_us',form);
    jQuery('#submit').attr('disabled',true);
    jQuery.ajax({
        url:link,
        data:formData,
        processData:false,
        contentType:false,
        type:'post',
        success:function(result){
            jQuery('#submit').attr('disabled',false);
            if(result.success==true){
                jQuery('#frmContactUs')[0].reset();
            }
            jQuery('#result_msg').html('<span class="'+result.success+'">'+result.data+'</span>')    
            //result.success
            //result.data
        }
    });
});    
</script>
-------------------------------------------
wp_contact_us.sql
------------------------
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 08, 2021 at 08:04 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `wordpress`
--

-- --------------------------------------------------------

--
-- Table structure for table `wp_contact_us`
--

CREATE TABLE `wp_contact_us` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `email` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `wp_contact_us`
--
ALTER TABLE `wp_contact_us`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `wp_contact_us`
--
ALTER TABLE `wp_contact_us`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
----------------------------------------------------------
function.php
<?php
add_action('wp_ajax_contact_us','ajax_contact_us');
function ajax_contact_us(){
$arr=[];
wp_parse_str($_POST['contact_us'],$arr);
global $wpdb;
global $table_prefix;
$table=$table_prefix.'contact_us';
$result=$wpdb->insert($table,[
"name"=>$arr['name'],
"email"=>$arr['email']
]);
if($result>0){
wp_send_json_success("Data inserted");
}else{
wp_send_json_error("Please try again");
}
}
?>
*******************************************************
Explain the steps to create a child theme in detail?
=========================================
   Ans: 1- First go activated theme folder and here create a folder ex- ABC-child 
        2- Go to ABC-child folder and under this create 2 files style.css and functions.php 
        3- Edit style.css and put 
         /*
       Theme Name: My Child Theme
Theme URI: https://example.com/my-child-theme/
Description: A child theme of the parent theme
Author: Your Name
Author URI: https://example.com/
Template: parent-theme (Put Parent theme folder same name (this is compulsory))
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

         4- Edit functions.php and put 
     <?php
     add_action( 'wp_enqueue_scripts', 'my_child_theme_enqueue_styles' );
     function my_child_theme_enqueue_styles() {
     wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
     wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array(
     'parent-style' ) );
     }
     ?>
*******************************************************
How to convert html template to wordpress ?
https://www.youtube.com/watch?v=oteQXOBHflU
https://www.free-css.com/free-css-templates/page268/lamoda
https://websblog.in/how-to-convert-html-to-wordpress-in-hindi/
*******************************************************
WordPress Interview Question
=========================================
   https://websitemakerking.com/
1- https://www.youtube.com/watch?v=a0zQ4tgpMqQ

Convert PSD To WordPress
https://www.youtube.com/watch?v=AT0Rccz-g44

1- What is Taxonomy and How to Create Custom Taxonomy (Category) in WordPress?

How to Make a Contact Form Plugin in WordPress 
https://www.youtube.com/watch?v=P83wjSNj7BM
https://www.youtube.com/watch?v=fkXsLCfuSSk

How to Insert data using Ajax in WordPress
https://www.youtube.com/watch?v=KnW2MivfpNI

plugin deve
https://www.youtube.com/watch?v=sd30AYHZQ8c&list=PL6Kd_lvAfBuYzxHmbOdoXjBuW6pFs_xja
https://www.youtube.com/watch?v=xDMv32i1OtY&list=PLwyFcQ0GXhmDQCD2xlFXO3RuO51-xdou1

Contact Form Creation in WordPress - Create your own contact form as a simple plugin
https://www.youtube.com/watch?v=1MvoIRXxM8A

use Custom wordpress ajax in plugins and in frontend wordpress | Hindi
https://www.youtube.com/watch?v=mnzPzMcdgcQ

How To Setup WordPress Multisite | How to create multiple websites in a single WordPress | In Hindi\
https://www.youtube.com/watch?v=g2HzrkMS6Z4

Shopify Interview Question
=========================================
https://www.shopify.com/ca/partners/shopify-cheat-sheet?shpxid=bb410e32-B21A-4B01-A3EB-5A65DB3B11D1
https://www.interviewbit.com/shopify-cheat-sheet/#shopify-mcq-questions  

Part 1 - Shopify App Development - Introduction to Building Shopify Apps from Scratch Using PHP
https://www.youtube.com/watch?v=tX1E8fuesSE
Wordpress Interview Question
=========================================
1- Use of single.php page?
2- how to show dynamic logo?
3- how many types page builder>
4- how to show author name? = <?php echo get_the_author(); ?>
5- what is substr? 
// Positive numbers:
echo substr("Hello world",6)."<br>"; = world
// Negative numbers:
echo substr("Hello world",-2)."<br>"; = ld
6- when delete header.php and footer.php then theme is work or not? yes theme is works.
7- necessary files to create custom theme on wordpress
8- what is hooks and how many types of hooks in wp?
9- what is acf and repeater plugin
10- how to create acf field and how to call on frontend 
 <?php the_field('Field name','Page ID'); ?>
 <?php the_field('phone_number1',32); ?>
11- what is widget in wp and how to show in frontend
12- how to create custom plugin in wp
13- what is cpt
*********************************************************
Learn Web Development Course
=========================================
SHOPIFY LIQUID LEARN WITH HANAN
https://www.youtube.com/watch?v=n0xJk4iGO78&list=PLozpfQW4uw21RcDXeUTrAf1_-P7cP6HmL

WS CUBETECH LEARN WORDPRESS
https://www.youtube.com/watch?v=aC0ais5QTwk&list=PLjVLYmrlmjGdNxIBIdaDEHtI4gAxaYoq1&index=4

https://www.youtube.com/watch?v=n2kIxH3wtdQ&list=PLT9miexWCpPV32bcnA0oKbtT8RU6kwnnC

Website Maker King LEARN WORDPRESS
https://www.youtube.com/watch?v=bfN_yMlimgY

best Custom plugin development by vishal
https://www.youtube.com/watch?v=RqKQU3F_NOM&t=988s

Geeky Shows
https://www.youtube.com/@geekyshows

yahoo baba
https://www.youtube.com/watch?v=uP3HVv1GCvc

https://www.w3schools.com/js/js_events.asp

Sheryians Coding School
https://www.youtube.com/@sheryians
*********************************************************