Skip to main content

Posts

Showing posts from September, 2019

How to create cool login form with image and login?

 create cool login form with image and login <html> <head> <style> section.elementor-element.elementor-element-809d463.elementor-section-boxed.elementor-section-height-default.elementor-section-height-default.elementor-section.elementor-top-section {     display: none; } .elementor-inner {     display: none; } .wrapper{ width:100%; height:100vh; display: flex;  justify-content: center;     align-items: center; } .wrap{ width:80%; margin:auto; } .full-box{ width: 800px; background: #fff; min-height: 500px; height: 525px; margin: auto; box-shadow: 0 30px 60px 0 rgba(0,0,0,.2); display: flex; } .login-left{ width: 55%; padding: 50px; position: relative; } input.field { width: 100%; height: 36px; border-radius: 4px; border: 1px solid #c7cfd8; font-size: 18px; margin-bottom: 20px; padding: 6px 12px;

How to align center div in div in html ?

align center div in div in html <html> <head> <style> .outer{ width: 100%; height: 100vh; background:red; } .container{ width: 35%; height: 60vh; background:blue; position: absolute; top:0; bottom: 0; left: 0; right: 0; margin: auto; } </style> </head> <body> <div class="outer"> <div class="container"> </div> </div> </body> </html> OR <html> <head> <style> .outer{ width: 100%;     height: 100vh;     background: red;     display: flex;     justify-content: center;     align-items: center; } .container{ width: 35%; height: 60vh; background:blue; } </style> </head> <body> <div class="outer"> <div class="container"> </div> </div> </body> </html>

how to upload image file in database in php in wordpress?

upload image file in database in php in wordpress <html> <head> <?php extract($_POST); global $wpsite; global $wpdb; if(isset($_POST['submit'])){ /* Upload  Image */ if ( ! function_exists( 'wp_handle_upload' ) )           require_once( ABSPATH . 'wp-admin/includes/file.php' );           $uploadedfile = $_FILES['file'];           $upload_overrides = array( 'test_form' => false );           $movefile = wp_handle_upload( $uploadedfile, $upload_overrides );           if ( $movefile ) {               //var_dump( $movefile );   //echo $movefile['url'];       } else {              echo "Possible file upload attack!\n"; } $downloadlink = $movefile['url']; $menutable=$wpdb->prefix.$wpsite."_menutable"; $wpdb->insert($menutable, array('item_name' => $itemname, 'item_type' => $itemtype, 'item_catagory' => $itemcata,

How to use if condition and change on scroll in jqurey?

 use if condition  and change on scroll in jqurey? <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script> <script> $(document).ready(function(){ var $w = $(window).scroll(function(){     if ( $w.scrollTop() > 1000 ) {          alert("hello");           } else {       // ...     } }); }); </script>
use javascript in php or how to redirect on any page in php <?php echo '<script LANGUAGE="JavaScript">window.location.href="'.site_url().'/ loginform ";</script>'; ?>

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-inpu

How to link css,jquery and ajax with all files via one wordpress function?

link css,jquery and ajax with all files via one wordpress function copy this code in wordpress function.php file or main plugin file? function ecom_scripts(){ wp_register_script( 'ecom-script', plugins_url('/js/custom.js', __FILE__), array( 'jquery' ), '', true );     wp_localize_script( 'ecom-script', 'myajax', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );     wp_enqueue_script( 'ecom-script' ); wp_register_style( 'ecom-style', plugins_url('/css/stylesheet.css', __FILE__), true );     wp_enqueue_style( 'ecom-style' ); } add_action("wp_enqueue_scripts","ecom_scripts");

How to create login and signup form in one box in html and css?

create login and signup form in one box <html> <head> <style> .col-2, label {     width: 100%;     float: left;     font-size: 20px;     margin-bottom: 3px; } .box {     width: 24%;     height: 362px;     border: 1px solid black; } input[type="text"], input[type="password"] {     width: 100%;     height: 40px;     font-size: 20px; } .wrap{ width:80%; margin:auto; } input[type="submit"] {     width: 82px;     height: 40px;     background-color: #61CE70;     font-size: 15px;     font-weight: 500;     padding: 11px;     margin-top: 2px; } p {     font-size: 15px;     font-weight: lighter;     letter-spacing: 1px; } h4 {     font-size: 24px;     font-weight: 700;     color: #61ce70; cursor: pointer; } .link{ color:red; } .loginform{ display:none; } </style> <script src="<?php echo plugin_dir_url(__FILE__);?>/js/jquery.min.js"></scrip

How to get wordpress site title name from url ?

get wordpress site title name from url  <?php // Exit if accessed directly if ( !defined( 'ABSPATH' ) ) exit; function oops_script(){ wp_enqueue_style("oops-style", plugin_dir_url(__FILE__)."style.css"); } add_action("wp_enqueue_scripts","oops_script"); /*+++++++ Declaring Global Variables +++++++++*/ $domain = site_url(); //or home $domain = str_replace('http://', '', $domain); $domain = str_replace('www', '', $domain); $domain = str_replace('.com', '', $domain); $domain = str_replace('/', '', $domain); $domain = str_replace('localhost', '', $domain);  $wpsite = $domain; ?> use it in another page with global variable <?php global $wpsite; echo $wpsite ; ?>

How to insert data from dynamically created add/remove fields in wordpress $wpdb? (second method)

insert data from dynamically created add/remove fields in wordpress $wpdb?  (second method) <html> <head>      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>  </head>      <script>          $(document).ready(function() {              $("#Add").on("click", function() { var backbone = $('.backbone').val(); $('.backbone').val(parseFloat(backbone) + 1); var newbackbone = $('.backbone').val();                 $("#textboxDiv").append("<div><input type='text' name='field" + newbackbone +"' placeholder='Field " + newbackbone +"'>"+ "<input type='text' name='field10" + newbackbone +"' placeholder='Field10" + newbackbone +"'>"+ "<input type='text' name='field200" + newbackbone +&q

How to insert data from dynamically created add/remove fields in wordpress $wpdb?

 insert data from dynamically created add/remove fields in wordpress $wpdb? <html> <head>      <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>  </head>    <script>          jQuery(document).ready(function($) {              $("#Add").on("click", function() { var backbone = $('.backbone').val(); $('.backbone').val(parseFloat(backbone) + 1); var newbackbone = $('.backbone').val(); $("#textboxDiv").append("<input type='text' name='a"+ newbackbone +"' placeholder='a " + newbackbone +"'>"+ "<input type='text' name='b"+ newbackbone +"' placeholder='b" + newbackbone +"'>"+ "<input type='text' name='c"+ newbackbone +"' placeholder='c" + newbackbone +"'