Skip to content

Instantly share code, notes, and snippets.

View mohsinrasool's full-sized avatar
💪

Mohsin Rasool mohsinrasool

💪
View GitHub Profile
@mohsinrasool
mohsinrasool / .gitignore
Last active November 20, 2021 15:50 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@mohsinrasool
mohsinrasool / fix-wordpress-permissions.sh
Created January 12, 2016 15:10 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@mohsinrasool
mohsinrasool / .htaccess
Created December 23, 2015 16:41 — forked from eveland/.htaccess
.htaccess
#Require SSL
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
@mohsinrasool
mohsinrasool / WordPress SQL Queries.sql
Created November 13, 2015 17:02 — forked from janikvonrotz/WordPress SQL Queries.sql
Wordpress SQL Queries #WordPress
-- Change Siteurl & Homeurl
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl'
-- Change GUID
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com')
-- Change URL in Content
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com')
-- Change Image Path Only
@mohsinrasool
mohsinrasool / Widget Classes
Created November 13, 2015 15:37 — forked from plechazunga/Widget Classes
WordPress
/**
* Add "first" and "last" CSS classes to dynamic sidebar widgets. Also adds numeric index class for each widget (widget-1, widget-2, etc.)
*/
function widget_first_last_classes($params) {
global $my_widget_num; // Global a counter array
$this_id = $params[0]['id']; // Get the id for the current sidebar we're processing
$arr_registered_widgets = wp_get_sidebars_widgets(); // Get an array of ALL registered widgets
if(!$my_widget_num) {// If the counter array doesn't exist, create it