/**
* Remove related products output
*/
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
add_filter('woocommerce_product_related_posts_query', '__return_empty_array', 100);
নাবিক মন কূল ফিরে পাবে
এই ভুলের হিসাব মোর জানি মিলে যাবে,
আর আমার নাবিক মন কূল ফিরে পাবে,
তাই আগের মতন আমি বুকভরা প্রেম নিয়ে আসি………
CSS/JS Cache Busting
/*
* Disable CSS/JS Cache
*/
function wpse_84670_time_as_version( $url ) {
return add_query_arg( array( 'ver' => time() ), $url );
}
add_filter( 'script_loader_src', 'wpse_84670_time_as_version' );
add_filter( 'style_loader_src', 'wpse_84670_time_as_version' );
Reorder Comment Forms Fields
/*
* Reorder Comment Forms Fields
*/
function ar_move_comment_field_to_bottom( $fields ) {
$comment_field = $fields['comment'];
unset( $fields['comment'] );
$fields['comment'] = $comment_field;
return $fields;
}
add_filter( 'comment_form_fields', 'ar_move_comment_field_to_bottom' );
Remove Website Field for Comment Form
/*
* Remove Website Field for Comment form
*/
function ar_comment_website_remove( $fields ) {
if ( isset( $fields['url'] ) ) {
unset( $fields['url'] );
}
return $fields;
}
add_filter( 'comment_form_default_fields', 'ar_comment_website_remove' );
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() {
if ( isset( $_COOKIE['ta_comment_wait_approval'] ) && $_COOKIE['ta_comment_wait_approval'] === '1' ) {
setcookie( 'ta_comment_wait_approval', '0', 0, '/' );
function ar_show_comment_mesg() {
echo "<p id='wait_approval'><strong>Your comment has been sent successfully & Waiting for Approval.</strong></p>";
}
add_action( 'comment_form_before', 'ar_show_comment_mesg' );
}
}
add_action( 'init', 'ar_comment_sent_message' );
function ar_comment_post_redirect( $location, $comment ) {
$location = get_permalink( $comment->comment_post_ID ) . '#wait_approval';
return $location;
}
add_filter( 'comment_post_redirect', 'ar_comment_post_redirect', 10, 2 );
Browser Sync
Install Browser Sync
Installing “Browser Sync” :
npm install -g browser-sync
Run Browse Sync
For Static Site
browser-sync start --server --directory --files "**/*"
Or
browser-sync start --server --files "*.*"
For Dynamic Site
browser-sync start --proxy "yoursitename.com" --files "**/*"
Add Login/Logout Link to Menu
function gl_loginout_menu_link( $items, $args ) {
if ($args->theme_location == 'primary') {
if (is_user_logged_in()) {
$items .= '<li class="right"><a href="'. wp_logout_url() .'">'. __("Log Out") .'</a></li>';
} else {
$items .= '<li class="right"><a href="'. wp_login_url(get_permalink()) .'">'. __("Log In") .'</a></li>';
}
}
return $items;
}
add_filter( 'wp_nav_menu_items', 'gl_loginout_menu_link', 10, 2 );
Redirect urls exactly, just change domain name with Apache
RewriteEngine On
RewriteCond %{HTTP_HOST} ^asique.me$ [OR]
RewriteCond %{HTTP_HOST} ^www.asique.me$
RewriteRule ^(.*)$ https://asique.net/$1 [R=301,L]
Redirect Type
301 Permanent Redirect
307 Temporary Redirect
Start by doing what’s necessary
Start by doing what’s necessary; then do what’s possible; and suddenly you are doing the impossible.
Francis of Assisi