Skip to main content

How to use shortcode in wordpress?

use shortcode in wordpress in function.php or main plugin file




function login_register(){
?>


<div  id="loginform">
<form method="post" action="">
<h4>Login</h4>
<div class="border"></div>
<div><span id="or">or<span><span id="full1"> create an account</span></div>
<div class="wrap-input100 validate-input" data-validate="Enter username">
<input class="input100" type="text" name="username">
<span class="focus-input100" data-placeholder="Username"></span>
</div>

<div class="wrap-input100 validate-input" data-validate="Enter password">
<input class="input100" type="password" name="pass">
<span class="focus-input100" data-placeholder="Password"></span>
</div>

<input type="submit" name="login" value="Submit">

</form>
</div>

<?php
}
add_shortcode("loginregister","login_register");

?>







anywhere


<?php

echo do_shortcode('[loginregister]');

?>

Comments

Popular posts from this blog

How to check date format in PHP?

Check date format in PHP function isCorrectDateFromat($date){     if(!empty($date)){         $dateString = $date; // Replace this with your date string         $format = "Y-m-d"; // Replace this with your expected date format         $dateTime = DateTime::createFromFormat($format, $dateString);         if ($dateTime === false) { /*             echo "The date is not in the correct format."; */         } else {             $errors = DateTime::getLastErrors();             if (empty($errors)) { /*                 echo "The date is in the correct format."; */                 return true;             } else { /*                 echo "...