Why is having a single heading H1 tag important for SEO?

Headings help Google grasp the main topic of a post. If you have multiple H1 tags, Google might get confused. A proper heading structure is also very important for your readers to understand the structure of your post.

Do you want to improve your H1?

If you use H1 tags in the body of your text, we advise moving it to the top of your text. Find all H1s in your text that aren’t your main title and change them to a lower heading level. An H1 is the title of your page or blog post, and you should only use it once per article.  Other headings can be used more than once, as long as they are structured hierarchically.

 

Advertisements

WordPress Reservation Form Plugin Using by Ajax

You need to create a PHP file in plugin directory and copy below the snippets

<?php
/*
Plugin Name: Ajax Reservation Form
Plugin URI: http://example.com
Description: Reservation Form
Version: 1.0
Author: Ataur Rahman
Author URI: md-ataur.github.io
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ajaxrf
*/

defined( 'ABSPATH' ) or die( 'No script kiddies please!' );

if(!class_exists('AjaxReservationForm')){

	class AjaxReservationForm{

		public function __construct(){
			add_action('plugins_loaded', array($this, 'ajaxrf_load_textdomain' ));
			add_action('wp_enqueue_scripts', array($this, 'ajaxrf_enqueue_scripts'));
			add_shortcode( 'ajax_reservation_form', array($this,'ajaxrf_shortcode' ));
			add_action( 'wp_ajax_ajaxRSF', array($this, 'AjaxdataProcess') );
			add_action( 'wp_ajax_nopriv_ajaxRSF', array($this, 'AjaxdataProcess') );
		}
		public function ajaxrf_load_textdomain(){
			load_plugin_textdomain( 'ajax-reservation-form', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
		}
		public function ajaxrf_enqueue_scripts(){
			wp_enqueue_style( 'bootstrap', plugin_dir_url( __FILE__ ).'assets/public/css/bootstrap.min.css');
			wp_enqueue_script( 'ajax-reservation-js', plugin_dir_url( __FILE__ ).'assets/public/js/ajax-reservation.js', array( 'jquery' ), time(), true );
			$ajaxUrl = admin_url( 'admin-ajax.php');
			wp_localize_script( 'ajax-reservation-js', 'url', array('ajaxUrl' => $ajaxUrl) );
		}

		public static function AjaxdataProcess(){
			if (check_ajax_referer( 'rsf_nonce_action', 'rn', false )) {
				$name 	= sanitize_text_field( isset($_POST['RFname'])?$_POST['RFname']:'' );
				$email 	= sanitize_email( isset($_POST['RFemail'])?$_POST['RFemail']:'' );
				$phone 	= sanitize_text_field( isset($_POST['RFphone'])?$_POST['RFphone']:'' );
				$person = sanitize_text_field( isset($_POST['RFperson'])?$_POST['RFperson']:'' );
				$date 	= sanitize_text_field( isset($_POST['RFdate'])?$_POST['RFdate']:'' );
				$time 	= sanitize_text_field( isset($_POST['RFtime'])?$_POST['RFtime']:'' );
				$message 	= sanitize_text_field( isset($_POST['RFMessage'])?$_POST['RFMessage']:'' );
				if (!empty($name) && !empty($email) && !empty($phone) && !empty($person) && !empty($date) && !empty($time)) {					
					$email_message = wp_sprintf( "From: %s \nEmail: %s \nPhone: %s \nPersons: %s \nTime: %s \nMessage: %s", $name , $email, $phone, $person, $time, $message);		
					//$admin_email = get_option('admin_email');			
					wp_mail( 'contact@onlivetech.com', $name, $email_message );
					die ('<p class="alert alert-success">Successfully sent your reservation</p>');
				}else{
					die('<p class="alert alert-danger">Fields must no be empty</p>');
				}
				
			}
		}

		public static function ajax_reservation_form(){			
			?>
			<div class="container">
				<div class="col-md-6 offset-md-3">
					<div id="msg"></div>
	                <form action="<?php the_permalink(); ?>" id="Rform">
	                	<?php wp_nonce_field( 'rsf_nonce_action', 'rsf_nonce_field');?>
                        <div class="form-group">
                            <label for="name" class="label"><?php _e('Name','ajaxrf');?></label>
                            <input type="text" class="form-control" id="RFname">                            
                        </div>
                        <div class="form-group">
                            <label for="email" class="label"><?php _e('Email','ajaxrf');?></label>
                            <input type="email" class="form-control" id="RFemail">                           
                        </div>
                        <div class="form-group">
                            <label for="phone" class="label"><?php _e('Phone','ajaxrf');?></label>
                            <input type="text" class="form-control" id="RFphone">
                        </div>
                        <div class="form-group">
                            <label for="persons" class="label"><?php _e('Number of Persons','ajaxrf');?></label>
                            <select name="persons" id="RFperson" class="form-control">
                                <option value="1"><?php _e('1 person','ajaxrf');?> </option>
                                <option value="2"><?php _e('2 person','ajaxrf');?> </option>
                                <option value="3"><?php _e('3 person','ajaxrf');?></option>
                                <option value="4"><?php _e('4 person','ajaxrf');?></option>
                                <option value="5"><?php _e('5 person','ajaxrf');?></option>
                            </select>                            
                        </div>
                        <div class="row">
	                        <div class="form-group col-md-6">
	                            <label for="date" class="label"><?php _e('Date','ajax-reservation-form');?></label>
	                            <input type="date" class="form-control" id="RFdate">	                            
	                        </div>
	                        <div class="form-group col-md-6">
	                            <label for="time" class="label"><?php _e('Time','ajax-reservation-form');?></label>
	                            <input type="time" class="form-control" id="RFtime" autocomplete="off">
	                        </div>
                        </div>	 
                        <div class="form-group">
                        	<textarea class="form-control" id="RFMessage" rows="5"></textarea>
                        </div>                 
	                    <div class="row justify-content-center">
	                    	<button id="reserveForm" class="btn btn-primary"><?php _e('Reserve Now','ajax-reservation-form');?></button>
	                    </div>
	                </form>
	            </div>
			</div>
			<?php
		}

		public function ajaxrf_shortcode(){
			// Turn on output buffering.
    		ob_start();

			self::ajax_reservation_form(); // echo the form

			// Turn off output buffering and then return the output echoed via the above functions.
    		return ob_get_clean();
		}
	}

	new AjaxReservationForm;
}

You need to create a js file and copy below the snippets

;(function($){
	$(document).ready(function(){		
		$('#reserveForm').on('click', function(){
			$.post(url.ajaxUrl, {
				action: 'ajaxRSF',
				rn: $('#rsf_nonce_field').val(),
				RFname: $('#RFname').val(),
				RFemail: $('#RFemail').val(),
				RFphone: $('#RFphone').val(),
				RFperson: $('#RFperson').val(),
				RFdate: $('#RFdate').val(),
				RFtime: $('#RFtime').val(),
				RFMessage: $('#RFMessage').val()
			}, function(data) {
				$('#msg').html(data);
				console.log(data);
				$('#Rform')[0].reset();
			});			
			return false;
		});
	});
})(jQuery);

Build Your Own WordPress Contact Form Using by Ajax

You need to create a template file and copy below the snippets

<?php
/**
 * Template Name: Ajax Contact Form
 */
get_header();
?>

<div class="container">
	<div class="col-md-6 offset-md-3">	
		<form action="<?php the_permalink(); ?>" method="post" id="cform">
			<?php wp_nonce_field('cf_nonce_action','cf_nonce_field'); ?>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label for="firstName"><?php _e("First Name","practice");?></label>
						<input type="text" class="form-control" id="firstName">
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label for="lastName"><?php _e("Last Name","practice");?></label>
						<input type="text" class="form-control" id="lastName">
					</div>
				</div>
			</div>
			<div class="row">
				<div class="col-sm-6">
					<div class="form-group">
						<label for="subject"><?php _e("Subject","practice");?></label>
						<input type="text" class="form-control" id="subject">
					</div>
				</div>
				<div class="col-sm-6">
					<div class="form-group">
						<label for="phone"><?php _e("Phone","practice");?></label>
						<input type="text" class="form-control" id="phone" >
					</div>
				</div>
			</div>
			<div class="form-group">
				<label for="email"><?php _e("Email Address","practice");?></label>
				<input type="email" class="form-control" id="email">
			</div>
			<div class="form-group">
				<label for="message"><?php _e("Message","practice");?></label>
				<textarea class="form-control" id="message" rows="5"></textarea>
			</div>
			<button type="submit" id="ajaxForm" class="btn btn-primary btn-block"><i class="fa fa-paper-plane"></i> <?php _e("Send Message","practice")?></button>
		</form>
	</div>
</div>

<?php get_footer();?>

Then you need to create a js file and copy below the snippets

;(function($){
	$(document).ready(function(){		
		$('#ajaxForm').on('click',function(){
			$.post(cfurl.ajaxurl,{
				action: 'ajaxContactForm',
				nonce: $('#cf_nonce_field').val(),
				firstName: $('#firstName').val(),
				lastName: $('#lastName').val(),
				subject: $('#subject').val(),
				phone: $('#phone').val(),
				email: $('#email').val(),
				message: $('#message').val(),
			}, function(data){
				alert(data);
				console.log(data);
				$("#cform")[0].reset();
			});			
			return false;
		});
	});
})(jQuery);

What we did on the js file.
First of all, question yourself what would you do. I would like to send user data to the WordPress or php by the form click event without page relode. We created a click event and then sent user data by jQuery post function.

Functions.php file

/**
 * Enqueue scripts and styles.
 */
function practice_scripts() {
	wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/public/css/bootstrap.min.css');	
	wp_enqueue_style( 'style', get_template_directory_uri() . '/assets/public/css/style.css');	
	wp_enqueue_style( 'practice-style', get_stylesheet_uri() );
	
	if (is_page_template('templates/ajax-contact-form.php')) {
		wp_enqueue_script( 'ajax-cf-js', get_template_directory_uri() . '/assets/public/js/ajax-contact-form.js', array( 'jquery' ), time(), true );
	}	

	$ajaxurl = admin_url('admin-ajax.php');	
	wp_localize_script( 'ajax-cf-js', 'cfurl', array('ajaxurl' => $ajaxurl) );

}
add_action( 'wp_enqueue_scripts', 'practice_scripts' );


/**
 * Ajax Contact Form
 */
function practice_ajaxContactForm(){	
	if(check_ajax_referer('cf_nonce_action', 'nonce')){
		$firstName = sanitize_text_field( isset($_POST['firstName'])?$_POST['firstName']:'' );
		$lastName = sanitize_text_field( isset($_POST['lastName'])?$_POST['lastName']:'' );
		$subject = sanitize_text_field( isset($_POST['subject'])?$_POST['subject']:'' );
		$phone = sanitize_text_field( isset($_POST['phone'])?$_POST['phone']:'' );
		$email = sanitize_email( isset($_POST['email'])?$_POST['email']:'' );
		$message = esc_textarea( isset($_POST['message'])?$_POST['message']:'' );
		if (!empty($firstName) && !empty($lastName) && !empty($subject) && !empty($phone) && !empty($email) && !empty($message)) {
			$_message = sprintf("From: %s \nEmail: %s \nPhone: %s \nMessage: %s", $firstName, $email, $phone, $message  );
			$admin_email = get_option('admin_email');		
			wp_mail( $admin_email, $subject, $_message );
			die('Successfully Message Sent');
		}else{
			die('Fields must not be empty!');
		}				
	}
}
add_action('wp_ajax_ajaxContactForm', 'practice_ajaxContactForm'); // Logged in
add_action('wp_ajax_nopriv_ajaxContactForm', 'practice_ajaxContactForm'); // Not Logged in

WP Common CSS

/**
 * Blog common css
 * # Blog Content
 * # Blog Pagination
 * # Blog search form
 * # Blog Comment area
 */

/**
 * woocommerce common css
 * # Product view page
 * # Cart page
 * # Checkout page
 * # Login page
 * # Account dashboard pages
 */

/* # Blog Content */
.entry-content ul, .entry-summary ul, .comment-content ul, .entry-content ol, .entry-summary ol, .comment-content ol{
    margin-left: 0;
}
.entry-content table, th, td {
    border: 1px solid #ebebeb;
    padding: 0.4375em;
}
.site-content {
    word-wrap: break-word;
}

/* # Blog Pagination */
.pagination .nav-links .current {
    background: #000;
    color: #fff;
    border: 1px solid #e7e7e7;
    width: 35px;
    height: 35px;
    margin: 0 2px;
    display: inline-block;
    text-align: center;
    line-height: 35px;   
    font-size: 14px;    
}
.pagination .nav-links a.page-numbers {
    border: 1px solid #e7e7e7;
    width: 35px;
    height: 35px;
    margin: 0 2px;
    display: inline-block;
    text-align: center;
    line-height: 35px;
    color: #444;
    font-size: 14px;
    transition:0.3s;
}

.pagination .nav-links a.page-numbers:hover {
   background: #000;
   color: #fff;
}

/* # Blog search form */
form.search-form {
    overflow: hidden;
}
.search-form label {    
    float: left;
    width: 75%;
}
.search-form .search-field {
    width:100%;
    height: 50px;
    padding: 15px 18px;
    border: 1px solid #ddd;
    font-size: 13px;
    font-weight: 500;
    font-family: Poppins;

}
.search-form .search-submit {
    position: absolute;
    right: auto;
    float: left;
    width: 25%;
    height: 50px;
    padding: 0;   
}
.page-content .search-form label {       
    width: 40%;
    float: left;
}
.page-content .search-form .search-submit {
    width: 100px;
}

/* # Blog Comment area */
.comments-area ol li:first-child .comment-body {
    border-top: none;
}
.comments-area ol .comment-body {
    border-top: 1px solid #eaedff;
    padding: 30px 0;
}
.comments-area ol.children li:first-child .comment-body {
    border-top: 1px solid #eaedff;
}
.comments-area h2.comments-title {
    color: #000000;
    font-size: 26px;
    margin-bottom: 20px;
    font-weight: 500;
}
.comments-area ol .comment-body .comment-author {
    float: left;
    margin: 0 20px 0px 0;
}
.comments-area ol .comment-body .comment-author img{
    width: 80px;
    height: 80px;
    border-radius: 50%;    
    margin: 0 0 16px;
    display: block;
}
.comments-area .comment-metadata{
    overflow: hidden;
    padding: 4px 0;
}
.comments-area .comment-content{
    overflow: hidden;
    padding-top: 4px;
}
.comment-metadata a {
    color: #646464;
}
.comment-metadata a:hover {
    color: #dd7e2e;
}
.comments-area .reply{    
    margin-top: 10px;
    text-align: right;
}
.comments-area ol .reply a {
    color: #6f7172;
    display: inline-block;
    font-size: 14px;
    font-weight: 400;
    transition: 0.3s;
}
.comments-area ol .reply a:before {
    font-weight: 900;
    font-family: "Font Awesome 5 Free";
    content: "\f3e5";
    margin: 0 5px 0 0;
}
.comments-area ol .reply a:hover {
    color: #dd7e2e;
}




/* # Product view page */
.woocommerce div.product div.images .flex-control-thumbs {
    margin: 30px 0 0;
}
.woocommerce div.product div.images .flex-control-thumbs li{
    margin: 0 15px 15px 0;
}
.page-content, .entry-content, .entry-summary{
    margin:0;
}
.summary.entry-summary .product_title.entry-title {
    font-size: 20px;    
    text-transform: uppercase;
    color: #222222;
    letter-spacing: 0.5px;
    margin: 0 0 12px;
    font-weight: 500;
}
.woocommerce div.product .woocommerce-product-rating {
    margin: 0 0 12px;
    padding: 0;
}
.woocommerce-product-rating .woocommerce-review-link{
    font-size: 14px;
}
.woocommerce .woocommerce-product-rating .star-rating {
    margin: 11px 10px 0 0;
    float: left;
}
.woocommerce .star-rating {
    float: right;
    overflow: hidden;
    position: relative;
    height: 1em;
    line-height: 1;
    font-size: 1em;
    width: 6.4em;
    font-family: star;
    letter-spacing: 3px;
}
.woocommerce .star-rating, .woocommerce-page .star-rating, .wpb_wl_summary .star-rating {    
    font-size: 12px;    
}
.woocommerce .summary .product_meta .posted_in, .entry-summary .sku_wrapper, .entry-summary .variations label, .woocommerce .summary .product_meta .tagged_as, .brand {
    color: #000;
    display: inline-block;    
    margin: 0;   
    font-weight: 500;
    width: 100%;    
    font-size: 13px;
    font-family: Poppins;
}
.woocommerce .summary .product_meta .posted_in a:hover, .woocommerce .summary .product_meta .tagged_as a:hover, .brand span a:hover, .social a:hover {
    color: #dd7e2e;
}
.woocommerce .summary .product_meta{
    padding: 0 0 30px;
}
.product_meta span {
    padding: 4px 0;
}
.entry-summary .sku {
    font-weight: normal;
    color: #838383;
}
.woocommerce .summary .product_meta .posted_in a, .woocommerce .summary .product_meta .tagged_as a, .brand span a, .social a {
    font-weight: normal;
    color: #838383;
}
.woocommerce .summary.entry-summary .variations select{
    font-size: 13px !important;
}
.woocommerce div.product form.cart .variations label{
    font-weight: 500;
}
.woocommerce div.product .stock{
    font-weight: 500;
}
.woocommerce div.product form.cart .variations{
    margin-bottom: 0;
}
.woocommerce .quantity input.qty{
    width: 60px;
    height: 50px;
    display: inline;
    margin: 0 3px;
    vertical-align: top;
}
.woocommerce #respond input#submit.disabled, .woocommerce #respond input#submit:disabled, .woocommerce #respond input#submit:disabled[disabled], .woocommerce a.button.disabled, .woocommerce a.button:disabled, .woocommerce a.button:disabled[disabled], .woocommerce button.button.disabled, .woocommerce button.button:disabled, .woocommerce button.button:disabled[disabled], .woocommerce input.button.disabled, .woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled]{
    padding: 14px 20px !important;
}
.woocommerce-tabs ul.tabs li.active a {
    background: #f5f5f5;
    color: #000;
}
.woocommerce div.product .woocommerce-tabs ul.tabs li a {    
    font-size: 15px;
    font-weight: 500;
    color: #000;
}
.woocommerce div.product .woocommerce-tabs .panel h2 {
    display: none;
}
.woocommerce div.product .woocommerce-tabs .panel h5 {
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
    color: #000;
}
.woocommerce div.product .woocommerce-tabs .panel ul, ol {
    margin: 0 0 25px;
}
.woocommerce div.product .woocommerce-tabs .panel ul li, ol li {
    color: #7e7e7e;
    font-size: 14px;
    font-weight: normal;
}
.woocommerce-tabs.wc-tabs-wrapper {
    margin: 50px 0;
    display: inline-block;
    width: 100%;
}
section.related.products h2 {
    font-size: 22px;    
    padding: 13px 0;
}
section.up-sells.upsells.products h2 {
    font-size: 22px;
    padding: 13px 0;
}
.woocommerce table.shop_attributes td, .woocommerce-page table.shop_attributes td {
    padding: 8px;
    border-top: 0;
    margin: 0;
    font-weight: normal;
    font-size: 14px;
    color: #7e7e7e;
    font-style: normal;
}
.woocommerce table.shop_attributes th{
    font-size: 14px;
    color: #000;
    font-weight: 600;
    font-weight: Poppins;
}
.woocommerce #reviews #comments ol.commentlist li .comment-text p.meta{
    font-family: Poppins;
    color: #000;
    font-size: 14px;
}
.woocommerce #respond input#submit:hover{
    background: #84b77c;
    color:#fff;
}
.woocommerce #review_form .comment-form p.comment-form-cookies-consent input {
    float: left;
    margin: 6px 5px 0 0;
}

/* # Cart page */
.woocommerce table.shop_table th, .woocommerce-page table.shop_table th {
    font-size: 13px;
    font-weight: 600;
    line-height: 40px;
    background: #f5f5f5;
    color: #000;
}
.woocommerce table th, td {
    border: 1px solid #ebebeb;
}
.woocommerce table th {
    border-width: 0 1px 0px 0;
    font-weight: 600;
}
.woocommerce table th, td {
    border-width: 0 1px 0px 0;
}
#add_payment_method table.cart img, .woocommerce-cart table.cart img, .woocommerce-checkout table.cart img {
    width: 40px;
    box-shadow: none;
}
.woocommerce table.shop_table .woocommerce-Price-amount {
    color: #787878;
}
.woocommerce .return-to-shop a.button{
    font-weight: 400;
    background: #000;
    padding:15px;
    color:#fff;
}
.woocommerce section.shipping-calculator-form button.button {
    padding: 0 15px;
    height: 40px;
}
.woocommerce .return-to-shop a.button:hover{
    background: #84b77c;
    color:#fff;
}
.woocommerce-error, .woocommerce-info, .woocommerce-message{    
    font-size: 14px;
    letter-spacing: 0.3px;
}
.woocommerce .quantity .qty{
    font-size: 13px;
}
.woocommerce a.remove{
    color:#000 !important;
    font-size: 18px;
}
.woocommerce table.shop_table{
    font-size: 14px;
}
.woocommerce table.cart td.actions .input-text, .woocommerce-page #content table.cart td.actions .input-text, .woocommerce-page table.cart td.actions .input-text {
    width: auto;
    border: 1px solid #e5e5e5;
}
.woocommerce-error, .woocommerce-info, .woocommerce-message{
    border-top: 2px solid #000;
    font-size: 14px;
    letter-spacing: 0.3px;
    font-family: Poppins;
    font-weight: 400;
}
.woocommerce-message::before{
    color:#000;
}
.woocommerce button.button{
    padding: 0px 20px;
    height: 50px;
    background-color: #000;
    font-weight: 400;
    color:#fff;
    transition: 0.3s;
    font-size: 14px;
    line-height: unset;
    cursor: pointer;
}
.woocommerce button.button:hover{
    background-color: #84b77c;
    text-decoration: none;
    background-image: none;
    color: #fff;
}
.woocommerce .woocommerce-message a.button:hover {
    background: #84b77c;
    color: #fff;
}
.woocommerce .woocommerce-message a.button{
    font-weight: 500;
}

.woocommerce #respond input#submit.disabled, .woocommerce #respond input#submit:disabled, .woocommerce #respond input#submit:disabled[disabled], .woocommerce a.button.disabled, .woocommerce a.button:disabled, .woocommerce a.button:disabled[disabled], .woocommerce button.button.disabled, .woocommerce button.button:disabled, .woocommerce button.button:disabled[disabled], .woocommerce input.button.disabled, .woocommerce input.button:disabled, .woocommerce input.button:disabled[disabled]{
    padding: 12px 20px;
}

.woocommerce .cart-collaterals, .woocommerce-page .cart-collaterals .cart_totals h2 {
    font-size: 20px;
    text-align: right;
    font-weight: 400;
    margin: 0 0 20px;
}
.woocommerce .cart-collaterals .cart_totals table th, .woocommerce-page .cart-collaterals .cart_totals table th {
    padding: 6px 12px 6px 10px;
    width: 50%;
    background: #f5f5f5;
    font-weight: 500;
    font-size: 13px;
    line-height: 40px;
    font-family: Poppins;
}
.woocommerce .cart-collaterals .cart_totals table td, .woocommerce .cart-collaterals .cart_totals table th, .woocommerce-page .cart-collaterals .cart_totals table td, .woocommerce-page .cart-collaterals .cart_totals table th {
    vertical-align: middle;    
    letter-spacing: 0.3px;
}
p.woocommerce-shipping-destination strong {
    font-weight: 400;
}
p.woocommerce-shipping-destination {
    font-size: 13px;
}
.form-row{
    display: block;
}
.select2-container--default .select2-selection--single{
    border: 1px solid #ebebeb;
    height: 38px;
}

.select2-container, .select2-container--default .select2-selection--single .select2-selection__rendered {
    font-size: 13px;
    letter-spacing: 0.5px;
    line-height: 38px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 38px;
}
.woocommerce form .form-row input.input-text, .woocommerce form .form-row textarea {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    outline: 0;
    line-height: normal;
    border: 1px solid #f0f0f0;
    padding: 8px 10px;
    font-size: 13px;
}
tr.order-total td span.woocommerce-Price-amount.amount {
    color: #000;
    font-weight: 600;
    font-size: 16px;
}
.woocommerce a.button.alt  {
    padding: 20px 25px;
    float: right;
    font-size: 15px;
    letter-spacing: 0.5px;
    font-weight: 400;
}

/* # Checkout page */
.woocommerce .col2-set .col-1, .woocommerce-page .col2-set .col-1 {
    float: left;
    width: 49%;
    max-width: none;
}
.woocommerce .col2-set .col-2, .woocommerce-page .col2-set .col-2 {
    float: right;
    width: 49%;
    max-width: none;
}
.woocommerce table.shop_table tfoot td, .woocommerce table.shop_table tfoot th, .woocommerce-page table.shop_table tfoot td, .woocommerce-page table.shop_table tfoot th {
    font-weight: 600;
    background: none;
}
.woocommerce-info {
    border-top-color: #000;
}
.woocommerce-info::before {
    color: #0b0b0b;
}
.woocommerce form.checkout_coupon, .woocommerce form.login, .woocommerce form.register{
    border: 0 ;  
    margin: 0;
    outline: 0;   
}

.woocommerce form .form-row label{
    color: #222;
}
.woocommerce .col2-set .col-1, .woocommerce-page .col2-set .col-1, .woocommerce .col2-set .col-2, .woocommerce-page .col2-set .col-2, .woocommerce-MyAccount-content {
    box-sizing: border-box;
    padding: 20px 30px;
    background: #f5f5f5;
}
.woocommerce .col2-set .col-1 h3, .col-2 h3 {
    font-size: 20px;
}
#order_review_heading {
    font-size: 20px;
    margin: 30px 0;
}
table.shop_table.woocommerce-checkout-review-order-table th {
    font-size: 13px;
    letter-spacing: 0.5px;
    font-family: Poppins;
}
.woocommerce form .form-row textarea, .woocommerce-page form .form-row textarea {
    min-height: 150px;
}
.woocommerce-checkout #payment {
    background: #f5f5f5;
    border-radius: 5px;
}
#add_payment_method #payment div.payment_box, .woocommerce-cart #payment div.payment_box, .woocommerce-checkout #payment div.payment_box{
    background-color: #eeeeee;
}
#add_payment_method #payment div.payment_box::before, .woocommerce-cart #payment div.payment_box::before, .woocommerce-checkout #payment div.payment_box::before{
    border: 1em solid #eeeeee;
    border-right-color: transparent;
    border-left-color: transparent;
    border-top-color: transparent;
}
ul.wc_payment_methods.payment_methods.methods label {
    font-size: 14px;
}
.woocommerce #respond input#submit, .woocommerce a.button, .woocommerce button.button, .woocommerce input.button{
    font-weight: 500;
    color: #fff;
    font-size: 14px;
    background: #000;
}

/* # Login page */
.u-column1.col-1 h2, .u-column2.col-2 h2{
    font-size: 20px;
}
.u-column1.col-1 form {
    padding: 0;
}
.u-column2.col-2 form {
    padding: 0;
}

/* # Account dashboard pages */
.woocommerce-MyAccount-navigation ul {
    margin: 0;
}
.woocommerce-MyAccount-navigation ul li a:before {
    content: "\f3fd";
    display: inline-block;
    float: right;
    font-family: 'Font Awesome 5 Free';
    font-kerning: auto;
    font-size: 15px;
    font-size-adjust: none;
    font-stretch: normal;
    font-style: normal;
    font-variant: normal;
    font-weight: 900;
    line-height: 22px;
    margin-left: 0.53em;
    text-align: right;
    text-rendering: auto;
    width: 3em;
    opacity: 0.8;
    -khtml-opacity: 0.8;
    -webkit-opacity: 0.8;
    -moz-opacity: 0.8;
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--orders a:before {
    content: "\f291";
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--downloads a:before {
    content: "\f019";
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--edit-address a:before {
    content: "\f015";
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--edit-account a:before {
    content: "\f007";
}
.woocommerce-MyAccount-navigation ul li.woocommerce-MyAccount-navigation-link--customer-logout a:before {
    content: "\f2f5";
}
.woocommerce-MyAccount-navigation ul li {
    border-bottom: 1px solid #ebebeb;
    list-style-type: none;
}
.woocommerce-MyAccount-navigation ul li a {
    padding: 10px 0;
    display: block;
    text-transform: capitalize;
    font-size: 14px;
    font-weight: 500;
    color: #666666;
}
.woocommerce-MyAccount-navigation ul li.is-active a, .woocommerce-MyAccount-navigation ul li a:hover {
    color: #000000;
}
.u-columns.woocommerce-Addresses.col2-set.addresses address {
    font-size: 14px;
}
form.woocommerce-EditAccountForm.edit-account legend {
    font-size: 18px;
}
.woocommerce-MyAccount-content a.woocommerce-button.button:hover {
    background: #84b77c;
    color:#fff;
}
a.woocommerce-Button.button {
    background: none;
    color: #000;
}
.woocommerce table.my_account_orders .button{
    font-size: 12px;
}
section.woocommerce-customer-details h2 {
    font-size: 22px;
}
section.woocommerce-customer-details address {
    font-size: 14px;
}
.woocommerce-column.woocommerce-column--1.woocommerce-column--billing-address.col-1 {
    padding: 0;
}
.woocommerce-column.woocommerce-column--2.woocommerce-column--shipping-address.col-2 {
    padding: 0;
}
.woocommerce .woocommerce-customer-details address{
    border-bottom-width: 1px;
    border-right-width: 1px;
}



@media (max-width: 767.98px) {
    /* responsive woocommerce */
    .woocommerce .cart-collaterals .cart_totals, .woocommerce-page .cart-collaterals .cart_totals {
        width: 100%;
    }
    .woocommerce table.shop_table td, th {
        padding: 10px !important;
        font-size: 13px;
    }
    .woocommerce a.button.alt{
        float: none !important;
    }
    .woocommerce .col2-set .col-1, .woocommerce-page .col2-set .col-1 {        
        width: 100%;       
    }
    .woocommerce .col2-set .col-2, .woocommerce-page .col2-set .col-2 {       
        width: 100%;       
    }
    .woocommerce-account .woocommerce-MyAccount-navigation {
        float: left;
        width: 100%;
        margin: 0 0 30px 0;
    }
    .woocommerce-account .woocommerce-MyAccount-content {
        float: right;
        width: 100%;
    }
    .woocommerce ul.products[class*=columns-] li.product, .woocommerce-page ul.products[class*=columns-] li.product{
        width: 100%;
    }
    .woocommerce nav.woocommerce-pagination{
        margin: 0 0 50px;
    }

}

@media (min-width: 768px) {
    /* responsive woocommerce */
    .woocommerce .cart-collaterals .cart_totals,
    .woocommerce-page .cart-collaterals .cart_totals {
        width: 100%;
    }
    .woocommerce .col2-set .col-1, .woocommerce-page .col2-set .col-1 {        
        width: 100%;       
    }
    .woocommerce .col2-set .col-2, .woocommerce-page .col2-set .col-2 {       
        width: 100%;       
    }
    .woocommerce-account .woocommerce-MyAccount-navigation {
        float: left;
        width: 100%;
        margin: 0 0 30px 0;
    }
    .woocommerce-account .woocommerce-MyAccount-content {
        float: right;
        width: 100%;
    }    
}

@media (min-width: 992px) {
    /* responsive woocommerce */
    .woocommerce .cart-collaterals .cart_totals,
    .woocommerce-page .cart-collaterals .cart_totals {
        width: 50%;
    }
    .woocommerce .col2-set .col-1, .woocommerce-page .col2-set .col-1 {        
        width: 49%;       
    }
    .woocommerce .col2-set .col-2, .woocommerce-page .col2-set .col-2 {       
        width: 49%;       
    }
    .woocommerce-account .woocommerce-MyAccount-navigation {
        float: left;
        width: 20%;
    }
    .woocommerce-account .woocommerce-MyAccount-content {
        float: right;
        width: 75%;
    }
    .woocommerce nav.woocommerce-pagination{
        margin: 0px;
    }
}

@media (min-width: 1200px) {
    .woocommerce #content div.product div.images, .woocommerce div.product div.images, .woocommerce-page #content div.product div.images, .woocommerce-page div.product div.images{
        width: 40%;
    }
    .woocommerce #content div.product div.summary, .woocommerce div.product div.summary, .woocommerce-page #content div.product div.summary, .woocommerce-page div.product div.summary{
        width: 56%;
    }
}

Woocommerce error face

archive-product.php or search page doesn’t work on my theme
The solution for me was to add theme support… Which, it’s been a while since I used woocommerce, so I completely forgot about that. But after adding the following line to my functions.php file, archive-product.php is now being used (/mytheme/woocommerce/archive-product.php) and I can update it, as I should be able to.

add_theme_support('woocommerce');

Simple Tips to Getting Approved on ThemeForest

HTML markup validation:

Please check HTML markup validation before developing a theme.

WordPress Code:

The following functions must be present:

	
	wp_head() - just before </head>
	wp_footer() - just before </body>
	body_class() - inside <body> or <html> tags
	post_class()
  • WordPress theme files and directories must be named using lowercase letters. Words must be separated by hyphens, not camelCase or underscores.
  • Themes must not add any entries to the admin bar and must not remove, hide
  • The $content_width variable must be used to define the maximum allowed width for images, videos, and oEmbeds displayed within a theme
  • Default WordPress CSS classes must be covered in the stylesheet.
  • WP_Filesystem methods must be used where available instead of direct PHP filesystem calls. For example, mkdir, fopen, fread, fwrite, fputs, etc., must not be used.

Prefix Everything:

For my WordPress themes, I use the themename_ prefix all around, as it is simple and clean.

	<?php 

	// Functions
	function prefix_setup()
	
	// Classes
	class Prefix_Class {}

	// Global Variables
	global $prefix_passengers;

	// Action Hooks
	do_action( ‘prefix_start_engine’ );

	// Filter Hooks
	$register = apply_filters( prefix_register );

	// Non Third-Pary Script Handles
	wp_enqueue_script( 'prefix-functions', get_template_directory_uri() . 'js/custom/functions.js' );

	// Non Third-Pary Style Handles
	wp_enqueue_style( 'prefix-minified-style', get_template_directory_uri() . 'style.min.css' );

	// Images
	add_image_size( 'prefix-large', 800, 600 );

	?>		

Properly Include Scripts and Styles:

Do Not Prefix Third Party Scripts. Themes must use the scripts shipped with WordPress instead of including their own copy of the script or using one from a CDN. This includes jQuery, jQuery UI, Backbone, Underscore, etc. protocol-relative formats such as //example.com/file.js instead of http://example.com/file.js

	
	<?php

	/**
	 * Third Party Styles
	 * More info: https://github.com/grappler/wp-standard-handles
	 */
	 
	// Incorrect 
	wp_enqueue_style( 'prefix-font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array(), '4.2.0', 'all' );

	// Corrrect 
	wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.css', array(), '4.2.0', 'all' );

	/**
	 * Third Party Scripts
	 */
	 
	// Incorrect 
	wp_enqueue_script( 'prefix-fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array( 'jquery' ), '1.1.1', true );

	// Corrrect 
	wp_enqueue_script( 'jquery-fitvids', get_template_directory_uri() . '/js/jquery.fitvids.js', array( 'jquery' ), '1.1.1', true );

	?>	

Font Loading:

The fonts must be enqueued using wp_enqueue_style().

wp_enqueue_style( 'theme-prefix-fonts', "//fonts.googleapis.com/css?family=Lora:400,700|Inconsolata:700", '', '1.0.0', 'screen' );

Escape Everything:

	
	<?php

	// Use anytime HTML element encloses a section of data:
	echo esc_html( $no_html );

	// Use on all URLs, including those in the 'src' and 'href' attributes of an HTML element:
	<img src="<?php echo esc_url( $escaped_url ); ?>" />

	// Use for inline Javascript:
	<a href="#" onclick="<?php echo esc_js( $escaped_js ); ?>">
		<?php esc_html__( 'Click Here', 'text-domain' ); ?>
	</a>

	// Use for an HTML attribute:
	<div class="<?php echo esc_attr( $escaped_class ); ?>">

	?>		

Pluggable functions use:

A function can only be reassigned this way once, so you can’t install two plugins that plug the same function for different reasons. For safety, it is best to always wrap your functions with
if( ! function_exists(‘wp_mail’) ) { } , otherwise you will produce fatal errors on plugin activation.

PHP Code:

It is recommended that development is done with errors enabled and WP_DEBUG set to true. Follow the coding standard WordPress PHP Coding Standards.

  • Themes must work with the latest release of PHP. There is no required minimum supported version of PHP
  • The create_function() function has been deprecated as of PHP 7.2.0 and must no longer be used.
  • The “@” operator must not be used to suppress error messages or notices.
  • Tabs must be used for indentation
  • The creation of global variables is discouraged. They should be used only if absolutely necessary. If used, they must follow the prefixing rules.
  • The eval() function must not be used.

Check for PHP Errors and Warnings:

One of the easiest errors to check for is standard PHP errors. Enable wp_debug and go to town self-reviewing your theme to ensure there are no PHP errors, notices or warnings anywhere. You should also check for errors every time you submit an update.

HTML/CSS Code:

Note: It is strongly recommended that your theme follows both the WordPress HTML Coding Standards and the WordPress CSS Coding Standards.

  • CSS styling must not be hardcoded anywhere within a theme, either inline or in a tag.
  • A table of contents at the top of the stylesheet to act as a guide is required.
  • Dynamic styling must be added via wp_add_inline_style() with the exception of adding a background image to an element. In this instance, the following would be permitted:
  • 		<div id="header-background" style="background-image: url( <?php echo esc_url( '$header-background' ); ?> );"></div>
    	
  • IDs and classes must be appropriately named and follow a naming convention.
  • Strongly Recommended that all your code be run through the W3C validator. Items will be soft-rejected for important errors such as unclosed tags, nesting errors, duplicate IDs, etc.

JavaScript Code:

It is strongly recommended that your theme follow the WordPress JavaScript Coding Standards.

  • JavaScript code must be placed in external files whenever possible.
  • If defined in the global scope, all functions and variables should be prefixed with a unique identifier.
  • Unbind all event handlers before binding.
  • If PHP variables or data need to be passed to JavaScript, wp_localize_script() must be used.
  • If using jQuery, then .on() must be used instead of .click(), .bind(), .hover(), etc.
  • Development and debugging code such as console.log() must be removed.
  • Strict mode must be used for all JavaScript. For example, for jQuery:
	(function($) {
      "use strict";
      // your code here
   })(jQuery);

Translation Ready:

  • All theme text strings must be translatable
  • Text strings must not contain variables or constants
  • The text domain must use dashes rather than underscores and be lowercase plain-text.
  • Translation file should be in English and delivered as a .pot file. The .pot will contain all translation strings. The .pot file name should match the theme-slug (i.e. themeslug.pot).
  • Themes can include actual translation files (.po/.mo) for any variety of specific languages, but must not add the en_US.mo or en_US.po because English is already implied.

Theme Security Requirements:

Validation
Where possible, data must be validated on input. Although validation may occur on the client side, this cannot be solely relied on. The data also needs to be revalidated on the server side before the data is saved.
For more information on validation, refer to Data Validation article.Data Validation

Sanitization
If data cannot be validated on input, it must be sanitized instead.For example, it may not be possible to validate a text field, instead, it should be sanitized using the sanitize_text_field() or wp_kses() functions.For more information on sanitization, refer to Data Sanitization/Escaping

Working with the Database
Themes must not work directly with the database to create, update or delete site content and should generally only use WordPress core functions to display content.If there is a valid reason to work with the database, then the wpdb class provided by WordPress must be used. SQL statements must be prepared using $wpdb->prepare().

Escaping Output
WordPress core functions that return dynamic data must be escaped by the theme, except for those core functions starting with ‘the_’, which are generally escaped already. For example, home_url, admin_url, get_permalink, get_header_image, etc., should be escaped, but the_content, the_permalink, etc., are not required to be escaped.

Nonces
Any data that is submitted to the server must use nonces. If a user is allowed to submit data to the server, a nonce must be used to verify the origin and intent of the request.

SVG Upload
Themes must not enable SVG uploads as it raises security concerns due to the possibility of attackers executing malicious code through SVG’s XML.

Update TGMPA:

Keep in mind that every time you release a new version of your theme, you should double check that the latest version of TGMPA is included.

Properly Include Plugins Using TGMPA:

	<?php
	
	// Include a plugin from the WordPress Repository:
	array(
	  'name'      => esc_html__( 'WooCommerce', 'text-domain' ),
	  'slug'      => 'woocommerce',
	  'required'  => false,
	),

	// Include a plugin bundled within a WordPress theme:
	array(
	  'name'      => esc_html__( 'Example Plugin', 'text-domain' ),
	  'slug'      => 'example-plugin',
	  'source'    => get_template_directory() . '/inc/plugins/example-plugin.zip',
	  'required'  => false,
	),

	?> 	

Disable TGMPA Force Actions:

Every user should have free rein to activate or deactivate any WordPress plugins installed on their website.

Core Features:

1.Themes must not use features/APIs meant for WordPress core.
2.Themes must be widget-ready in all advertised locations. All widgetized areas must be appropriately styled to match the theme/demo design.
3.wp_nav_menu() must be included in at least one theme location. Menu locations may only display placeholders such as Add Menu and Set Menu if the current user is a logged in admin user and no menu has yet been set.
4.Themes must not unregister default WordPress widgets. Instead, new widgets should be registered via a plugin.
5.Must support all of the following features:

  • Comments
  • Sidebars
  • Editor style
  • Title tag

6.index.php must be reserved for the standard blog “latest posts” view.
7.Content, including placeholder/demo content, must not be hardcoded into the template files.
8.Admin code should be kept separate from public facing code via the is_admin() conditional to prevent unauthorized access.
9.Specify column names instead of * in your queries.

Menu Position:

If the theme has an Options page and no other sub menu items, then it must go in either the Customizer (strongly recommended) or the Appearance section.

Customizer:

Users are increasingly expecting to find theme options within the Customizer. All Customizer settings must be properly validated and sanitized with an appropriate sanitization callback.

Child Themes:

If a child theme is provided with the theme, it must:

  • Load the parent stylesheet using wp_enqueue_style() instead of @import.
  • Consist of style.css, functions.php and screenshot.png files at a minimum.
  • Append “Child” to the theme name so it can be identified as a child theme.

Plugin Territory Functionality:

  • Analytics code
  • SEO options
  • Forms
  • Non-design related meta boxes
  • Resource caching
  • Dashboard widgets
  • Custom Post Types
  • Custom Taxonomies
  • Shortcodes
  • Widgets
  • Social media like, follow and, share buttons
  • Framework related metabox

Third-Party Plugins & Libraries:

If you include plugins with your theme, you must use the TGM Plugin Activation (TGM PA) library.

  • You must keep included plugins and libraries up to date.
  • The force_activation and force_deactivation TGM PA parameters must not be set to true.
  • For plugins included in the zip file, the version TGM PA parameter must be set and kept up to date
  • You must not rename the original class-tgm-plugin-activation.php file to anything else.
  • Bundled plugins must be included in the main zip file.

Checking for Plugins:

Do not use is_plugin_active() when checking whether a plugin is active or not. is_plugin_active() is not reliable as it depends on the plugin’s folder/filename(which may change). Instead, you can use function_exists() or class_exists() as these are more reliable.

Import & Export Plugin:

Importers must not add content without user permission. Importers must not overwrite current content without clear warnings to the user. Custom Importers must use the WP Filesystem API.
Import/export functionality should be included via a plugin such as One Click Demo Import

Theme Unit Test Data:

Common issues are table display errors, image alignments, responsive comments, pingbacks display errors, password-protected post styling issues, and search index mishaps.

Run Theme Check:

Theme Check is literally the easiest way to check your WordPress theme against the latest coding standards and techniques. You can use Envato Theme Check plugin.

Provide Offline and online Documentation:

Documentation can be either publicly accessible online or included in the archive offline. Having offline documentation ensures that your customers are not hanging when there is not an Internet connection available or when your files are inaccessible – for any reason.

Admin login system own way

Routing:

web.php

Route::get('admin-login', 'Admin\Auth\LoginController@showLoginForm')->name('admin.login');
Route::post('admin-login', 'Admin\Auth\LoginController@login');

Controllers > Auth folder copy and paste it Controllers > Admin folder
Controllers > LoginController.php
Copy from AuthenticatesUsers.php and paste LoginController.php
You have to override that functions

<?php

namespace App\Http\Controllers\Admin\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class LoginController extends Controller
{
   
    use AuthenticatesUsers;

    /**
     * Where to redirect users after login.
     *
     * @var string
     */
    protected $redirectTo = 'admin/home';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    
    public function showLoginForm()
    {
        return view('admin.login');
    }

    public function login(Request $request)
    {
        $this->validateLogin($request);

        if ($this->attemptLogin($request)) {
            return $this->sendLoginResponse($request);
        }

        // If the login attempt was unsuccessful we will increment the number of attempts
        // to login and redirect the user back to the login form. Of course, when this
        // user surpasses their maximum number of attempts they will get locked out.
        $this->incrementLoginAttempts($request);

        return $this->sendFailedLoginResponse($request);
    }

    public function __construct()
    {
        $this->middleware('guest')->except('logout');
    }
    
    protected function guard()
    {
        return Auth::guard('admin');
    }
}

We need to create guard config > auth.php

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This option controls the default authentication "guard" and password
    | reset options for your application. You may change these defaults
    | as required, but they're a perfect start for most applications.
    |
    */

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],

        'admin' => [
            'driver' => 'session',
            'provider' => 'admins',
        ],

        'api' => [
            'driver' => 'token',
            'provider' => 'users',
        ],
    ],

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\User::class,
        ],
        'admins' => [
            'driver' => 'eloquent',
            'model' => App\Model\admin\admin::class,
        ],

        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],


    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_resets',
            'expire' => 60,
        ],
        'admins' => [
            'provider' => 'admins',
            'table' => 'password_resets',
            'expire' => 60,
        ],
    ],

];

We need to define our model

<?php

namespace App\Model\admin;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class admin extends Authenticatable
{
    use Notifiable;
}

login.blade.php for view

<!DOCTYPE html>
<html>
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <title>AdminLTE 2 | Log in</title>
      <!-- Tell the browser to be responsive to screen width -->
      <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
      <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
      <!-- Google Font -->
      <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
   </head>
   <body class="hold-transition login-page">
      <div class="container">
         <div class="col-lg-4 offset-lg-4">
            <center>
               <h3>Admin Login</h3>
            </center>
            @include('includes.message')
            <form action="{{route('admin.login')}}" method="post">
               {{csrf_field()}}
               <div class="form-group has-feedback">
                  <input type="email" class="form-control" name="email" placeholder="Email">
                  <span class="glyphicon glyphicon-envelope form-control-feedback"></span>
               </div>
               <div class="form-group has-feedback">
                  <input type="password" class="form-control" name="password" placeholder="Password">
                  <span class="glyphicon glyphicon-lock form-control-feedback"></span>
               </div>
               <div class="form-group">
                  <div class="col-xs-8">
                     <div class="checkbox icheck">
                        <label>
                        <input type="checkbox"> Remember Me
                        </label>
                     </div>
                  </div>
                  <div class="col-xs-4">
                     <button type="submit" class="btn btn-primary">Sign In</button>
                  </div>
               </div>
            </form>
            <a href="{{ route('password.request') }}">
            Forgot Your Password?
            </a>
         </div>
      </div>
   </body>
</html>

আপনি কি বেশি খুঁতখুঁতে?

বারবার হাত ধোয়া, ঘর থেকে বেরিয়ে চুলা নেভানো হয়েছে কি না—তা দেখতে আবার ঘরে ঢোকা, খাওয়ার আগে ধোয়া প্লেট বা গ্লাস আবার ধোয়া—কখনো কখনো কারও মধ্যে এ রকম একই চিন্তা, অনুভূতি বা কাজের ইচ্ছা থাকে। তৈরি হয় উৎকণ্ঠা আর তীব্র মানসিক চাপ। জীবনকে করে তোলে বিষময়। আক্রান্ত ব্যক্তি এসব চিন্তা, অনুভূতিকে দমন করতে চায়, এড়িয়ে চলতে চায়। এ জন্য একই কাজ বারবার করতে শুরু করে। মানসিক স্বাস্থ্যের এই সমস্যার নাম অবসেসিভ কম্পালসিভ ডিসঅর্ডার (ওসিডি), যা সাধারণ পরিচ্ছন্নতা বা সাধারণ গুছিয়ে রাখার প্রবণতার মতো নয়, তার চাইতে অনেক বেশি, যেটি রীতিমতো রোগের পর্যায়ে পড়ে।

এই চিন্তা ও আচরণ মনের মধ্য থেকেই তৈরি হয়। রোগী নিজেও বুঝতে পারে যে এগুলো ভিত্তিহীন বা অযৌক্তিক, কিন্তু তা–ও চিন্তাটা সরাতে পারে না। এগুলোর পেছনে প্রতিদিন অনেক কর্মঘণ্টা নষ্ট হয়। কাজকর্মও ব্যাহত হয়। শরীর নোংরা হওয়ার ভয়, অহেতুক সন্দেহ, কোনো অমূলক শারীরিক সমস্যা নিয়ে চিন্তা, সবকিছুর মধ্যে নিখুঁত সামঞ্জস্য তৈরি করার ভাবনা, বিনা কারণে উত্তেজিত হয়ে যাওয়া, অস্বাভাবিক ও অতিরিক্ত যৌন চিন্তা, ধর্মীয় বিষয়ে অস্বাভাবিক চিন্তা, বারবার একই জিনিস পরীক্ষা করা (দরজা বন্ধ কি না, তা অনেকবার দেখা), অসংখ্যবার হাত ধোয়া, বেশি সময় ধরে গোসল করা বা বাথরুমে থাকা, কোনো কিছু বারবার গোনা (অনেকবার টাকা গুনে দেখা), একই প্রশ্ন বারবার করা, সবকিছু নিখুঁতভাবে সাজিয়ে রাখার চেষ্টা করা, প্রয়োজনীয়-অপ্রয়োজনীয় সবকিছু সংগ্রহে রাখা অর্থাৎ পরে কাজে লাগতে পারে ভেবে অপ্রয়োজনীয় বস্তুটিও ফেলে না দেওয়া ইত্যাদি হচ্ছে ওসিডির সাধারণ লক্ষণ। ওসিডি দমন করতে না পেরে আগ্রাসী আচরণ বা অত্যধিক রাগ হতে পারে কারও কারও।
পরিবারের কেউ এমন আচরণ করলে হেসে উড়িয়ে দেওয়ার কিছু নেই। ভাববেন না যে ও তো এ রকমই, একটু বেশি শুচিবায়ু বা খুঁতখুঁতে।

ওসিডি একটি রোগ এবং এর সুনির্দিষ্ট চিকিৎসা রয়েছে। চার থেকে আট সপ্তাহের মধ্যে ওষুধের প্রভাবে কিছুটা উন্নতি দেখা দিতে পারে। তবে পুরোপুরি ফল পেতে অপেক্ষা করতে হয় কয়েক মাস। ওষুধের পাশাপাশি ধারণা ও আচরণ পরিবর্তনকারী চিকিৎসা (কগনিটিভ-বিহেভিয়ার থেরাপি) এ রোগের জন্য বিশেষ কার্যকরী।

উৎস: প্রথম আলো

File Storage

The public disk is intended for files that are going to be publicly accessible. By default, the public disk uses the local driver and stores these files in storage/app/public. To make them accessible from the web, you should create a symbolic link from public/storage to storage/app/public.

To create the symbolic link, you may use the storage:link Artisan command:

php artisan storage:link

File Uploads

if ($request->hasFile('image')) {
    $fileName =  $request->image->store('public');
}
$post->image  = $fileName;
$post->save();

Retrieving Files

File URLs

use Illuminate\Support\Facades\Storage;
$image_src  = Storage::url($post->image);
return $image_src;

or

return Storage::disk('local')->url($post->image)