Skip to content

Instantly share code, notes, and snippets.

View sajjad-talebi's full-sized avatar

sajjad talebi sajjad-talebi

  • jolfa
View GitHub Profile
@soderlind
soderlind / server.conf
Last active December 15, 2022 17:24
NGINX, WordPress Multisite and robots.txt, also tested with WordPress MU Domain Mapping
server {
# Add the following to your default server block:
rewrite /robots\.txt$ /index.php?robots=1 last;
}
@bradtraversy
bradtraversy / docker_wordpress.md
Last active October 8, 2025 11:15
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@wpbean
wpbean / functions.php
Last active April 2, 2024 10:37
LearnPress Course Tab Customize
<?php
/**
* Add meta box for custom tab content
*/
add_filter( 'bright_custom_meta_options', 'bright_course_custom_meta' );
function bright_course_custom_meta($options){
$options[] = array(
@MoienTajik
MoienTajik / iranian-phone-numbers-regex.md
Last active November 22, 2025 07:20
Regex For Iranian Mobile Phone Numbers

Regex For Iranian Phone Numbers

This regex supports all kinds of Iranian mobile phone numbers :

^(\+98|0)?9\d{9}$


Regex Visualized

<?php
/*
This script will allow you to send a custom email from anywhere within wordpress
but using the woocommerce template so that your emails look the same.
Created by [email protected] on 27th of July 2017
Put the script below into a function or anywhere you want to send a custom email
*/
@eversionsystems
eversionsystems / woocommerce-ajax-checkout-spinner.css
Last active July 24, 2024 23:52
WooCommerce Change AJAX Spinner Gif On Checkout
/*
* Custom AJAX spinner on WooCommerce checkout
* The class used to load the overlay is .blockUI .blockOverlay
* The class used to load the spinner is .woocommerce .loader:before
*
*/
.woocommerce .blockUI.blockOverlay:before,.woocommerce .loader:before {
height: 3em;
width: 3em;
position: absolute;
@vishalbasnet23
vishalbasnet23 / functions.php
Created October 31, 2014 08:57
User Registration Front End WordPress with Ajax
<?php
add_action('wp_ajax_register_user_front_end', 'register_user_front_end', 0);
add_action('wp_ajax_nopriv_register_user_front_end', 'register_user_front_end');
function register_user_front_end() {
$new_user_name = stripcslashes($_POST['new_user_name']);
$new_user_email = stripcslashes($_POST['new_user_email']);
$new_user_password = $_POST['new_user_password'];
$user_nice_name = strtolower($_POST['new_user_email']);
$user_data = array(
'user_login' => $new_user_name,
@merina
merina / functions.php
Last active December 21, 2020 05:59
Remove comment title reply, after and before notes & website URL - WordPress
<?php
//------------- Remove comment Title Reply + before & after notes
add_filter( 'comment_form_defaults', 'afn_custom_comment_form' );
function afn_custom_comment_form($no_fields) {
$no_fields['comment_notes_before'] = ''; // Removes comment before notes
$no_fields['comment_notes_after'] = ''; // Removes comment after notes
$no_fields['title_reply'] =''; // Remove Title Reply
return $no_fields;
}
<?php
/*
* WordPress Breadcrumbs
* author: Dimox
* version: 2019.03.03
* license: MIT
*/
function dimox_breadcrumbs() {
/* === OPTIONS === */
@tommcfarlin
tommcfarlin / add-custom-post-type-menu.php
Created April 25, 2013 12:38
[WordPress] Add a custom post type menu as a child of an existing custom post type menu.
<?php
// Define the 'Portfolio' post type. This is used to represent galleries
// of photos. This will be our top-level custom post type menu
$args = array(
'labels' => array(
'all_items' => 'Gallery',
'menu_name' => 'Portfolio',
'singular_name' => 'Gallery',
'edit_item' => 'Edit Gallery',