Skip to content

Instantly share code, notes, and snippets.

View salehahmadbabu's full-sized avatar

Saleh Ahmad salehahmadbabu

View GitHub Profile
add_filter('script_loader_tag', 'clean_script_tag');
function clean_script_tag($input) {
$input = str_replace("type='text/javascript' ", '', $input);
return str_replace("'", '"', $input);
}
/*comment template css*/
.comments-area {
margin-top: 40px;
}
.comments-area h2.comments-title {
font-size: 25px;
margin-bottom: 20px;
}
/* Sidebar widget CSS */
.widget h2 {
font-size: 25px;
color: #555;
}
.widget ul {
margin: 0;
padding: 0;
function philosophy_google_map($atts) {
$default = array(
'place' => __( 'Dhaka', 'philosophy' ),
'width' => '800',
'height' => '500',
'zoom' => '12',
);
$params = shortcode_atts( $default, $atts );
global $wp_query;
wp_register_script( 'understrap_loadmore', get_stylesheet_directory_uri() . '/myloadmore.js', array('jquery') );
wp_localize_script(
'understrap_loadmore',
'understrap_loadmore_params',
array(
'ajaxurl' => site_url() . '/wp-admin/admin-ajax.php',
'posts' => json_encode( $wp_query->query_vars ),
@salehahmadbabu
salehahmadbabu / pmpro_add_billing_fields_to_profile.php
Created July 24, 2020 01:49 — forked from strangerstudios/pmpro_add_billing_fields_to_profile.php
Add PMPro billing fields to the edit user profile page. You must Paid Memberships Pro and the Register Helper plugin installed. Then add this to a custom plugin or your active theme's functions.php
/*
Add PMPro billing fields to the edit user profile page.
You must Paid Memberships Pro and the Register Helper plugin installed:
http://wordpress.org/extend/plugins/paid-memberships-pro
https://github.com/strangerstudios/pmpro-register-helper
*/
function add_billing_fields_to_profile()
{
global $pmpro_countries;
function owp_remove_menu_items() {
if( !current_user_can( 'administrator' ) ):
remove_menu_page( 'edit-comments.php' );
remove_menu_page( 'edit.php?post_type=elementor_library&tabs_group=library' );
endif;
}
add_action( 'admin_menu', 'owp_remove_menu_items' );
add_action('admin_head', 'hide_templates_menu_for_users');
body.login.login-password-protected {
position: relative;
overflow: hidden;
display: flex;
justify-content:center;
align-items: center;
}
body.login.login-password-protected:after {
position: absolute;
// add nav menu class & sub-menu class
function v123_nav_class($classes, $item)
{
if (in_array('menu-item-has-children', $classes)) {
$classes[] = 'dropdown';
}
return $classes;
}
add_filter('nav_menu_css_class', 'v123_nav_class', 10, 2);
<?php
// collection of walker classes
class Walker_Mobile_Menu extends Walker_Nav_Menu
{
function start_lvl(&$output, $depth = 0, $args = null)
{
$output .= "\n<ul class=\"dropdown-menu\">\n";