Skip to content

Instantly share code, notes, and snippets.

View Galibri's full-sized avatar
🏠
Working from home

Muhammad Asadullah Al Galib Galibri

🏠
Working from home
View GitHub Profile
@Galibri
Galibri / functions.php
Created October 1, 2019 18:51
Register Sidebar
register_sidebar( array(
'name' => esc_html__( 'My Sidebar', 'text-domain' ),
'id' => 'my-sidebar',
'description' => esc_html__( 'Add sidebar widgets here.', 'text-domain' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h2 class="widget-title">',
'after_title' => '</h2>',
) );
@Galibri
Galibri / .htaccess
Created October 1, 2019 18:40
Leverage Browser Caching and Enable Compression
# Enable Compression
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
@Galibri
Galibri / contact-form-7-redirect.php
Created October 1, 2019 18:06
Contact Form 7 Redirect using functions.php file.
add_action( 'wp_footer', 'bsd_cf7_redirect_wp_footer' );
function bsd_cf7_redirect_wp_footer() {
?>
<script type="text/javascript">
document.addEventListener( 'wpcf7mailsent', function( event ) {
// here 4423 is the id of the form, replace it with your form id
if ( '4423' == event.detail.contactFormId ) {
location = 'https://secova.com/thank-you-demo';
}
if( ! function_exists( 'bs_breadcrumb' ) ) {
bs_breadcrumb();
}
@Galibri
Galibri / laravel-unique-slug.php
Last active July 3, 2020 21:59
Laravel Unique slug, Very easy stuffs..
<?php
/**
* Crate method
* Change Product to your desired model name, dont' forget to import the Model and Str classname.
* Change whereSlug to where_(your_slug_field_name) with CamelCase
*/
public function store(Request $request) {
$unique_slug = Str::slug($request->title);
$unique_next = 2;
<?php
$year = date('y');
$study_year = $year . ($year + 1);
$dept_code = 123;
$year_code = $study_year . $dept_code;
add_filter( 'pre_get_document_title', function( $title ){
if(is_page('shop')){
return "This is my shop, believe it or not! hahaha.... | " . get_bloginfo('description');
} else {
return $title;
}
}, 999, 1 );
$options[] = array(
'name' => 'header_options',
'title' => 'Header options',
'icon' => 'fa fa-plus-circle',
'sections' => array(
array(
'name' => 'logo_options',
'title' => 'Logo',
'icon' => 'fa fa-check',
'fields' => array(
<?php
function industry_rrfonline_custom_css(){
$body_font = cs_get_option('body_font');
$diffrent_heading_font = cs_get_option('diffrent_heading_font');
$heading_font = cs_get_option('heading_font');
if(!empty($body_font)){
$body_font_family = $body_font['family'];
}else{
<?php
$my_name = "Muhammad Asadullah Al Galib";
$my_age = 24;
$my_location = "Mirpur 2";
echo 'My name is ' . $my_name . '<br />';