Skip to content

Instantly share code, notes, and snippets.

@prajwal-stha
prajwal-stha / .htaccess
Created August 5, 2016 01:28
.htaccess file to remove "public" from url
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
FTP Credentail:
Username: lifestone-demo.motts.co
Pwd: }WWb8XOX~ywI
Admin Credentails:
Username: admin
Pwd: 123goldkist
@prajwal-stha
prajwal-stha / .htaccess
Created September 9, 2016 01:06
Prevent search engines from indexing your site
Header set X-Robots-Tag "noindex, nofollow"
@prajwal-stha
prajwal-stha / functions.php
Created September 9, 2016 01:11
Utilizing the GetText Filter
function translate_string( $translated_text, $untranslated_text, $domain ) {
if ( $translated_text == 'Related Products') {
$translated_text = __( 'Other Great Products', 'woocommerce' );
}
return $translated_text;
}
add_filter( 'gettext', 'translate_string', 15, 3 );
@prajwal-stha
prajwal-stha / add-to-cart.php
Created September 20, 2016 15:48 — forked from claudiosanches/add-to-cart.php
WooCommerce - Template add-to-cart.php with quantity and Ajax!
<?php
/**
* Custom Loop Add to Cart.
*
* Template with quantity and ajax.
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
global $product;
@prajwal-stha
prajwal-stha / filters.php
Created October 1, 2016 10:04
Adding the SVG Format to the Allowed File Types
//add SVG to allowed file uploads
function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
}
add_action('upload_mimes', 'add_file_types_to_uploads');
@prajwal-stha
prajwal-stha / Remove novalidate Comment Form Wordpress
Created October 2, 2016 16:46 — forked from ivanildodias/Remove novalidate Comment Form Wordpress
Remove "novalidate" attribute in default WordPress Comment Form
ob_start();
$commenter = wp_get_current_commenter();
$req = get_option( 'require_name_email' );
$aria_req = ( $req ? " aria-required='true'" : '' );
$html_req = ( $req ? " required='required'" : '' );
$span_req = ( $req ? ' <span class="required">*</span>' : '' );
comment_form( array(
'title_reply' => __( 'Leave your thoughts', 'issimple' ),
'comment_notes_after' => '',
function add_opengraph_doctype($output) {
return $output . '
xmlns="https://www.w3.org/1999/xhtml"
xmlns:og="https://ogp.me/ns#"
xmlns:fb="http://www.facebook.com/2008/fbml"';
}
add_filter('language_attributes', 'add_opengraph_doctype');
//Add Open Graph Meta Info from the actual article data, or customize as necessary
function facebook_open_graph() {
global $post;
if ( !is_singular()) //if it is not a post or a page
return;
if($excerpt = $post->post_excerpt)
{
$excerpt = strip_tags($post->post_excerpt);
$excerpt = str_replace("", "'", $excerpt);
}
var country_arr = new Array("Afghanistan", "Albania", "Algeria", "American Samoa", "Angola", "Anguilla", "Antartica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Ashmore and Cartier Island", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "British Virgin Islands", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Clipperton Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo, Democratic Republic of the", "Congo, Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czeck Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Europa Islan