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 / related-posts-2.php
Last active December 26, 2019 21:34 — forked from raselahmed7/related-posts.php
[WordPress Related Post]
@Asikur22
Asikur22 / function.php
Last active April 10, 2019 14:21 — forked from raselahmed7/enable-masonry.php
[Enable Built-In JavaScript Masonry in WordPress] #Enqueue #Scripts
function jk_masonry() {
wp_enqueue_script( 'jquery-masonry', array( 'jquery' ) );
}
add_action( 'wp_enqueue_scripts', 'jk_masonry' );
/*
How to use?
$('#container').masonry({ singleMode: true });
@Asikur22
Asikur22 / header.php
Last active April 10, 2019 15:29
[WordPress Title Tag]
<title>
<?php
if (function_exists('is_tag') && is_tag()) {
single_tag_title("Tag Archive for &quot;"); echo '&quot; - '; }
elseif (is_archive()) {
wp_title(''); echo ' Archive - '; }
elseif (is_search()) {
echo 'Search for &quot;'.wp_specialchars($s).'&quot; - '; }
elseif (!(is_404()) && (is_single()) || (is_page())) {
wp_title(''); echo ' - '; }
@Asikur22
Asikur22 / page.php
Last active April 10, 2019 15:28 — forked from raselahmed7/homepage-only
[WordPress Homepage Only] #ConditionalTag
<?php if( is_home() || is_front_page() ) : ?>
<!-- Homepage Only Code -->
<?php else : ?>
<!-- Other Page Code -->
<?php endif; ?>
@Asikur22
Asikur22 / arrayzing.md
Last active April 10, 2019 16:00 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
@Asikur22
Asikur22 / PHP Array of Animate.css animation styles
Last active April 10, 2019 14:58 — forked from ohid/PHP Array of Animate.css animation styles
[A PHP Array of all animation style names from animate.css] #AnimateCSS
$animations = array(
'bounce' => 'bounce',
'flash' => 'flash',
'pulse' => 'pulse',
'rubberBand' => 'rubberBand',
'shake' => 'shake',
'swing' => 'swing',
'tada' => 'tada',
'wobble' => 'wobble',
'jello' => 'jello',
@Asikur22
Asikur22 / ContextCmder-Disable.reg
Last active April 10, 2019 14:56 — forked from jojobyte/ContextCmder-Disable.reg
[Cmder Context (Right-Click) Menu Item for Windows] #cmd #Registry
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@Asikur22
Asikur22 / function-3
Last active February 24, 2022 17:52
[CSS/JS/Image Cache Busting] #DisableCache #dev
/*
* Change img src for disable img cache.
* @TODO remove on Production.
*/
function wpse_84670_time_as_img_version($src) {
$src[0] = add_query_arg('dummy', time(), $src[0]);
return $src;
}
@Asikur22
Asikur22 / functions.php
Last active April 10, 2019 16:51
[Remove Website Field for WordPress Comment Form]
/*
* Remove Website Field for Comment form
*/
function ar_comment_website_remove( $fields ) {
if ( isset( $fields['url'] ) ) {
unset( $fields['url'] );
}
return $fields;
}
@Asikur22
Asikur22 / functions.php
Last active April 10, 2019 16:27
Show Custom Message After Posting Comment
/*
* Show Custom Message After post Comment.
*/
function ar_set_comment_cookies( $comment, $user ) {
setcookie( 'ta_comment_wait_approval', '1', 0, '/' );
}
add_action( 'set_comment_cookies', 'ar_set_comment_cookies', 10, 2 );
function ar_comment_sent_message() {