Skip to content

Instantly share code, notes, and snippets.

View Asikur22's full-sized avatar
๐Ÿ’œ
Web Developer | In Love with WordPress

Asiqur Rahman Asikur22

๐Ÿ’œ
Web Developer | In Love with WordPress
View GitHub Profile
@Asikur22
Asikur22 / .gitignore
Created April 17, 2019 10:02
[.gitignore] #Git
.idea
node_modules
.vscode
.DS_Store
.AppleDouble
.LSOverride
package-lock.json
# Thumbnails
._*
@Asikur22
Asikur22 / git.md
Last active April 17, 2019 17:09
[Git Add tag]

Add git tag

git tag -a v1.1.0 -m "Here is a message."

Show git tag

git tag
@Asikur22
Asikur22 / index.html
Created April 23, 2019 13:15
Eliminate Render-Blocking Font Awesome CSS
<script>
function loadCSS(e, t, n) {
"use strict";
var i = window.document.createElement("link");
var o = t || window.document.getElementsByTagName("script")[0];
i.rel = "stylesheet";
i.href = e;
i.media = "only x";
o.parentNode.insertBefore(i, o);
setTimeout(function () { i.media = n || "all" })
@Asikur22
Asikur22 / linux-commands.md
Last active April 29, 2019 16:29
Linux Command

Kill All Runing Programs (Reset Unity Launchar)

unity

Run files as root

sudo nautilus
@Asikur22
Asikur22 / .zshrc
Created May 5, 2019 19:47
Zip for WP #CommandLine
zipforwp() { FILENAME=`basename $1` && zip -r $FILENAME.zip $1 -x '/*.git/*' -x '/*.DS_Store' -x '/*.gitignore' -x '/*.idea/*' && echo 'Zipped!' | terminal-notifier -sound default }
@Asikur22
Asikur22 / ga.js
Last active January 23, 2024 16:40
GA Scripts #GA
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
jQuery(".et_pb_contact_form").each(function() {
var jqForm = jQuery(this);
var jsForm = this;
jqForm.submit(function(event) {
event.preventDefault();
gtag('event', 'submit', { 'event_category': 'Contact Us Form Tracking', 'event_action': 'submit', 'event_label': 'Form Completed' } );
@Asikur22
Asikur22 / functions.php
Created May 18, 2019 17:23
Add New Field To Attachment #Metabox #CustomMetabox
/*
* Show Image Id on Media Edit
*/
function ibenic_add_media_custom_field( $form_fields, $post ) {
$form_fields['info_ID'] = array(
'label' => __( 'Image ID' ),
'input' => 'html',
'html' => "<input type='text' class='text' readonly='readonly' onfocus='this.select();' value='" . esc_attr( $post->ID ) . "' /><br />",
);
@Asikur22
Asikur22 / functions.php
Last active December 9, 2023 16:31 — forked from chrisrouse/Show Feature Image on Post Admin
Add column to Admin Table show the feature image of a post.
<?php
/*
* Adds the new column to the Admin Post View as the first column.
*/
function my_columns_filter( $columns ) {
$column_thumbnail = array( 'thumbnail' => 'Thumbnail' );
$columns = array_slice( $columns, 0, 1, true ) + $column_thumbnail + array_slice( $columns, 1, null, true );
return $columns;
}
@Asikur22
Asikur22 / functions.php
Created May 18, 2019 20:01
Add Class to all Image with Filter
/*
* Add Class to all Image
*/
function alter_attr_wpse_102158( $attr ) {
$attr['class'] .= ' img-fluid';
return $attr;
}
add_filter( 'wp_get_attachment_image_attributes', 'alter_attr_wpse_102158' );
@Asikur22
Asikur22 / functions.php
Last active May 18, 2019 20:55
Modify Excerpt
/*
* Limit Excerpt Length
*/
function custom_excerpt_length($length) {
return 15;
}
add_filter('excerpt_length', 'custom_excerpt_length', 999);
/*
* Remove Wordpress More tag.