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
# Change [/home/public_html/yourwebsite/] to your absolute path | |
# Create a .htpasswd file | |
# Add guest:/ls2opk3b1puY >> login: guest | pw: guest | |
AuthUserFile /home/public_html/yourwebsite/.htpasswd | |
AuthName "Type Password" | |
AuthType Basic | |
Require valid-user | |
<IfModule mod_rewrite.c> | |
RewriteEngine On |
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 | |
/****** | |
Parallelize downloads across hostnames for WordPress. | |
Useful to boost static resources load speed on websites. | |
Recommended by GTmetrix, Pingdom, Google Speed Insights, and others. | |
See full post > https://medium.com/p/32e9dc2fec0c | |
In order to work properly, all subdomains/hostnames MUST have the same structure/path. Ex: | |
http://mydomain.com/wp-content/uploads/2015/11/myimage.jpg |
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 | |
/****** | |
Simple function to add custom content to posts/pages on WordPress. | |
Just add to functions.php | |
******/ | |
function custom_css_add() { | |
$post_id = $_GET['post'] ? $_GET['post'] : $_POST['post_ID'] ; | |
add_meta_box( |
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
INSERT INTO `deploy_wp_db1`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('5', 'admin', MD5('admin'), 'John Doe', '[email protected]', '', '2015-10-15 00:00:00', '', '0', 'John'); | |
INSERT INTO `deploy_wp_db1`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}'); | |
INSERT INTO `deploy_wp_db1`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '5', 'wp_user_level', '10'); |
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
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<style> | |
html body {width: 100%;height: 100%;padding: 0px;margin: 0px;overflow: hidden;font-family: arial;font-size: 10px;color: #6e6e6e;background-color: #000;} #preview-frame {width: 100%;background-color: #fff;}</style> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> | |
<script> | |
//function to fix height of iframe! | |
var calcHeight = function() { |
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
<html lang="en" class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | |
<style> | |
.frame { | |
width: 30%; | |
height: 30%; | |
background-size: cover; | |
float: left; } |
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
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://oldsite.com/', 'http://newsite.com'); |
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 | |
add_action('save_post', 'wpds_check_thumbnail'); | |
add_action('admin_notices', 'wpds_thumbnail_error'); | |
function wpds_check_thumbnail($post_id) { | |
// change to any custom post type | |
if(get_post_type($post_id) != 'post') | |
return; |
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( |
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); |
OlderNewer