This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Following scripts adds two SQL Procedures to move a WP network from main domain to sub directory ( here "/blogs" ). | |
run_command: to execute a sql query | |
update_options_tables: loop through all the options table and update the home and siteurl options | |
script at the end: updates the wp_blogs and wp_site table plus class the update_options_tables procedure | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Require SSL | |
<IfModule mod_rewrite.c> | |
RewriteCond %{HTTPS} off | |
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
</IfModule> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 'On'); | |
ini_set('html_errors', 0); | |
// ---------------------------------------------------------------------------------------------------- | |
// - Error Reporting | |
// ---------------------------------------------------------------------------------------------------- | |
error_reporting(-1); | |
// ---------------------------------------------------------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action('the_post', 'cs_setup_theme'); | |
function cs_setup_theme() { | |
//var_dump($_REQUEST); | |
if(is_page()) { | |
if(shortcode_exists( 'et_pb_fullwidth_portfolio' )) { | |
remove_shortcode('et_pb_fullwidth_portfolio'); | |
add_shortcode('et_pb_fullwidth_portfolio', 'cs_et_pb_fullwidth_portfolio'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
function circlePath(cx, cy, r){ | |
return 'M '+cx+' '+cy+' m -'+r+', 0 a '+r+','+r+' 0 1,0 '+(r*2)+',0 a '+r+','+r+' 0 1,0 -'+(r*2)+',0'; | |
} | |
circlePath (40, 60,30); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('.people img').click(function() { | |
$('.person_details').slideUp('slow',function(){ | |
$(this).remove(); | |
}); | |
$('.people img.clicked').each(function() { | |
var normalImg = NormalImgOf($(this).attr("src")); | |
$(this).attr("src", normalImg); | |
$(this).removeClass('clicked'); | |
}); |