Scroll to top

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]’);

?>

Leave a Reply

Your email address will not be published.