Skip to content

Instantly share code, notes, and snippets.

View prosantamazumder's full-sized avatar

Prosanta Mazumder prosantamazumder

View GitHub Profile
git config --global user.name "prosantomazumder"
git config --global user.email "[email protected]"
$ git init
$ git ls
$ git status
$ git add *
$ git commit -m "version 1.0.1"
$ git status
$ git push
$ git remote add origin "Git Repository URL here"
@prosantamazumder
prosantamazumder / PHP – MySQL visitor counter.php
Last active April 5, 2020 12:10
PHP – MySQL visitor counter
<?php
$servername = "localhost";
$username = "dbuser";
$password = "dbpassword";
$dbname = "dbname";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
@prosantamazumder
prosantamazumder / smooth Scroll Section by ID.js
Last active May 27, 2020 10:13
smooth Scroll Section by ID
function smoothScrollSectionID() {
$('.main-nav li > a').on('click', function (event) {
var target = $(this.getAttribute('href'));
if (target.length) {
event.preventDefault();
$('html, body').stop().animate({
scrollTop: target.offset().top - 80
}, 1000);
}
});
@prosantamazumder
prosantamazumder / nav Tabs.html
Last active April 4, 2020 08:42
jQuery Custom nav Tabs
<div class="row">
<div class="col-md-6">
<div id="tabs-content">
<div id="tab1" class="tab-content">
<h2>a/h2>
</div>
<div id="tab2" class="tab-content">
<h2>TAB CONTENT</h2>
</div>
<div id="tab3" class="tab-content">
@prosantamazumder
prosantamazumder / Walker_Nav_Primary.php
Created April 3, 2020 14:52
WordPress Quick Started Menu With Dropdown
<?php
/*
@package sunsettheme
========================
WALKER NAV CLASS
========================
*/
@prosantamazumder
prosantamazumder / create shortcode WordPress
Created April 2, 2020 20:27
create wp short code WordPress
SHORTCODE.PHP
------------------------
function functionname(){
ob_start();
?>
HTMLCODEHERE..
<?php
@prosantamazumder
prosantamazumder / Sublime Text Install Package Name
Created April 2, 2020 20:05
Sublime Text Install some helpful Package
Package Name
--------------------------
1. Emmet
2. AutoFileName
3. AllAutocomplete
4. BracketHighlighter
5. Local History
6. SublimeLinter
7. ColorPicker
8. MarkDown Editing
@prosantamazumder
prosantamazumder / jQuery Context Menu Down Website Keyboard Right Click Down or Off
Created April 2, 2020 19:49
jQuery Context Menu Down Website Keyboard Right Click Down or Off
$(function() {
"use strict";
document.addEventListener('contextmenu', function(e) {
e.preventDefault();
});
window.oncontextmenu = function () {
return false;
@prosantamazumder
prosantamazumder / Wp Menu Add Class li. Menu add class li a.
Last active May 13, 2020 08:48
If you Read Then Code Then you see How add Class in WordPress Menu With add Class jQuery
<?php
//Menu li add class
-----------------
function add_menuclass($ulclass) {
return preg_replace('/<li /', '<li class="scroll"', $ulclass);
}
add_filter('wp_nav_menu','add_menuclass');
@prosantamazumder
prosantamazumder / WordPress Login Logout Condition in Menu
Created April 2, 2020 19:33
If User Logged in then show something and show another
//Add This Code Function.php
function add_loginout_link( $items, $args ) {
if (is_user_logged_in() && $args->theme_location == 'primary_menu') {
$items .= '<li><a href="'. wp_logout_url() .'">Log Out</a></li>';
}
elseif (!is_user_logged_in() && $args->theme_location == 'primary_menu') {
$items .= '<li><a href="'. site_url('wp-login.php') .'">Log In</a></li>';
}
return $items;