This file contains 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
function custom_widget_init() { | |
register_sidebar( array( | |
'name' => 'Featured + Search', | |
'id' => 'featured_search1', | |
'before_widget' => '<div>', | |
'after_widget' => '</div>', | |
'before_title' => '<h2 class="featured_search1">', | |
'after_title' => '</h2>', | |
) ); | |
register_sidebar( array( |
This file contains 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
function add_scroll() { | |
if ( is_page( 'Home' ) ) { | |
echo '<div class="slide_anchor_holder active"><a class="slide_anchor_button anchor current" href="#scroll-down">See What Makes Us Different</a></div>'; | |
echo '<div class="slide_anchor_line"><span class="slide_anchor_line1"></span></div>'; | |
echo '<div class="latest_news"><a class="slide_anchor_button anchor current" href="#scroll-news">View Our Latest News</a></div>'; | |
} | |
} | |
add_action('wp_head', 'add_scroll' ); | |
This file contains 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 | |
/** | |
* The base configurations of the WordPress bla bla bla... | |
*/ | |
define('DB_NAME', 'project1_db'); | |
define('DB_USER', 'project1_usr1'); | |
define('DB_PASSWORD', 'db-password-here'); | |
define('DB_HOST', 'localhost'); |
This file contains 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 | |
PATH=/usr/sbin:/sbin:/bin:/usr/bin | |
now="$(date +"%Y-%m-%d-%H%M")" | |
# backup root_db1 mysql database | |
mysqldump -u root_usr1 -h localhost -p'your-password' root_db1 | gzip -f > ./public_html/_backups/db1-$now.sql.gz && | |
# backup site1/wp-content (wordpress content folder) and exclude .sass-cache folder (Cannot open: Permission denied) |
This file contains 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 | |
global $current_user; | |
get_currentuserinfo(); | |
function inject_admin_styles() { | |
echo '<style type="text/css">#menu-posts {display:none;} </style>'; | |
} | |
if ($current_user->user_login !== 'admin') { //replace this with your admin user |
This file contains 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
$(document).ready(function($){ | |
$(".wpb_image").each(function() { | |
var title = $(this).find('img').attr('alt'); | |
$(this).append('<div class="wpb_image_title"><h4>'+title+'</h4></div>'); | |
}); | |
}); |
This file contains 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 | |
global $wpdb; | |
$value = preg_replace("/\r\n|\r|\n/",'-',$value); //replace breaks by "-" | |
$sql = "INSERT INTO `".$wpdb->prefix."contacts` (`CONTENT`) values ('" . $value . "|WEBDEV|" . date("m.d.y h.i A") . "')"; | |
$wpdb->query($sql); |
This file contains 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
User-agent: * | |
Allow: / | |
Disallow: /cgi-bin | |
Disallow: /wp-admin | |
Disallow: /wp-includes | |
Disallow: /wp-content | |
Disallow: /xmlrpc.php | |
Allow: /wp-content/uploads/ | |
User-agent: Mediapartners-Google |
This file contains 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 | |
/**** | |
* Download lighbox js on http://lokeshdhakar.com/projects/lightbox/ | |
* Upload to your server Ex. /public_html/lightbox/ | |
*****/ | |
function enqueue_lightbox() { | |
wp_register_style( 'lightboxcss', get_stylesheet_directory_uri() . '/lightbox/css/lightbox.css' ); | |
wp_register_script('lightbox', get_stylesheet_directory_uri() . '/lightbox/js/lightbox.js','','',TRUE); |
This file contains 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 | |
function vc_integrate_custom() { | |
vc_map( array ( | |
"name" => "Team", | |
"base" => "team", | |
"category" => 'Custom', | |
"icon" => "icon-wpb-team", | |
"allowed_container_element" => 'vc_row', | |
"params" => array( |