top of page

Modifying Admin Bar Menu in WordPress

add_action( 'admin_bar_menu', 'add_links_to_admin_bar',999); function add_links_to_admin_bar($admin_bar) { $args = array( 'parent' =>...

Hide Header Footer Per Page

Selection of Pages Settings to Hide the header and footer so we can accumulate the page ids of pages to hide add_action( 'wp_footer',...

Add Body Class Per Page

Code for functions.php $pageid = get_queried_object_id();// to get current page id add_filter( 'body_class', function( $classes ) {...

Countdown Timer in JavaScript

<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1">...

.htaccess redirection to HTTPS

<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !on RewriteRule (.*) https://daydream-solutions.com%{REQUEST...

jQuery each Loop

jQuery(document).ready(function(){ jQuery('.tab-pane .col-4').each(function(){ if(jQuery(this).find('a img').length == 0){...

Create a Post Status Like Home Page in Backend

/*Generic Page*/ add_filter('display_post_states', 'victoria_custom_post_states',10,2); function victoria_custom_post_states( $states,...

Shortcodes Inside Text Area and Text Field

Requirement Solution Code // Allow shortcodes in ACF fields add_filter('acf/format_value/type=textarea', 'do_shortcode');...

Speed Optimisation on WordPress

The speed optimisation on word press depends on multiple factors we will discuss them here 1- Reduce External Script Request This can be...

Woo Commerce Order Complete Hook

function lqorder_payment_complete( $order_id ){ $order = wc_get_order( $order_id ); $email = $order->get_billing_email(); $voucher ...

Update Cart Qty in Site header via WooCommerce

Custom Code to be places in plugin code file add_filter( 'woocommerce_add_to_cart_fragments', 'woocommerce_header_add_to_cart_fragment' );...

Walker Menu in WordPress

/*Custom Header Menu*/ class IBenic_Walker extends Walker_Nav_Menu { function start_el(&$output, $item, $depth=0, $args=array(), $id =...

Transaction Control in Wordpress 1000 Users/Sec

if( 151 == $cf7->id ){ $cookieid = $posted_data['cookieid']; $cookie_status = get_post_meta ( $posted_data['cookieid'],...

Using Custom ACF Group in Block Editor

/*register custom flexible section*/ add_action('acf/init', 'my_acf_init_block_types'); function my_acf_init_block_types() { if(...

Invalidate and Abort Contact Form 7 on a condition.

Invalidating a contact form 7 address /*Add hidden field as cookie id*/ add_filter( 'shortcode_atts_wpcf7', 'custom_shortcode_atts_wpcf7_...

© 2020 by syednazrulhassan

bottom of page