Skip to content

Instantly share code, notes, and snippets.

View celticwebdesign's full-sized avatar

Darren Stevens celticwebdesign

View GitHub Profile
@celticwebdesign
celticwebdesign / Facebook share pop-up
Last active December 21, 2015 10:36
Facebook share pop-up
JS ----
$('a.share_facebook').click(function(e) {
e.preventDefault();
var url = $('a.share_facebook').data('url');
var title = $('a.share_facebook').data('title');
var descr = $('a.share_facebook').data('descr');
var image = $('#slideshow_thumbnails li.thumbnail1 img').attr('src');
var winWidth = 520;
var winHeight = 350;
var winTop = (screen.height / 2) - (winHeight / 2);
@celticwebdesign
celticwebdesign / gist:3080f1eb91a0842a439d
Created December 11, 2015 17:12
WordPress - change the login new password text (http://www.xxx.net/wp/wp-login.php?action=rp)
Add to functions.php
add_action( 'login_enqueue_scripts', 'enqueue_my_script' );
function enqueue_my_script( $page ) {
wp_enqueue_script( 'my-script', 'http://www.xxx.net/wp/wp-content/themes/xxx/js/myjs-file.js', null, null, true );
}
Add to new .js file in theme
add_filter( 'wp_login_errors', 'wpse_161709', 10, 2 );
function wpse_161709( $errors, $redirect_to )
{
if( isset( $errors->errors['confirm'] ) ) {
// echo "<pre>";
// print_r($errors->errors);
// echo "</pre>";
// echo $errors->errors['confirm'][0];
$errors->errors['confirm'][0] = "Please wait for and email, you don't need to do anything right now.";
@celticwebdesign
celticwebdesign / WordPress remove admin bar
Created December 9, 2015 09:12
WordPress remove admin bar
// Remove Admin bar
function remove_admin_bar()
{
// return true;
if (!current_user_can('administrator') && !is_admin()) {
return false;
} else {
return true;
}
}
@celticwebdesign
celticwebdesign / Gravity Forms confirmation styling
Created December 5, 2015 13:59
Gravity Forms confirmation styling
#gforms_confirmation_message_1 {
border-bottom: 1px solid #a5c199;
border-top: 1px solid #a5c199;
margin: 40px auto;
}
#gform_confirmation_wrapper_1 {
padding: 10px 0;
background: #dff0d8 none repeat scroll 0 0;
}
#gform_confirmation_message_1 {
@celticwebdesign
celticwebdesign / Gravity Forms Spinner
Last active June 1, 2016 23:15
Gravity Forms spinner
body img.gform_ajax_spinner {
/*display: none!important;*/
display: block;
margin: 10px 0 0 10px;
position: relative;
top:10px;
left:10px;
max-width: 16px;
}
@celticwebdesign
celticwebdesign / gist:0038f3a69e863492dbef
Created November 22, 2015 11:31
WordPress Title - CPT / WPML / Yoast SEO
<?php if(is_post_type_archive('service')):
if( ICL_LANGUAGE_CODE == "zh-hans" ) {
// $language = "chinese";
$page = 336;
} else {
// $language = "english";
$page = 95;
}
echo "<title>".get_post_meta($page, '_yoast_wpseo_title', true)."</title>";
elseif(is_post_type_archive('testimonial')):
@celticwebdesign
celticwebdesign / WordPress Pagination
Created August 26, 2015 16:16
Used on main archive page.
// functions.php
// Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin
function html5wp_pagination()
{
global $wp_query;
$big = 999999999;
echo paginate_links(array(
'base' => str_replace($big, '%#%', get_pagenum_link($big)),
'format' => '?paged=%#%',
/* ------------------------------------
Gravity Forms Bootstrap
Help from https://gist.githubusercontent.com/DevinWalker/7110951/raw/8f6863c52df3cc0d627bb1e18e9cb832b5ecf395/gravity-forms_bootstrap
https://wordpress.org/plugins/gravity-forms-bootstrap-3-style/
---------------------------------------*/
.gform_wrapper ul{padding-left:0;list-style:none}.gform_wrapper li{margin-bottom:15px}.gform_wrapper form{margin-bottom:0}.gform_wrapper .gfield_required{padding-left:1px;color:#b94a48}.ginput_container input,.ginput_container select,.ginput_container textarea, #theme-my-login input{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.428571429;color:#555;vertical-align:middle;background-color:#fff;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.gin
@celticwebdesign
celticwebdesign / Bootstrap additional grid sizes
Last active January 6, 2016 10:14
Provides a smaller grid - 480px to 991px
/*
* Bootstrap additional grid sizes
*/
@media only screen and (min-width: 480px) and (max-width: 991px) {
.col-xxs-1, .col-xxs-2, .col-xxs-3, .col-xxs-4, .col-xxs-5, .col-xxs-6, .col-xxs-7, .col-xxs-8, .col-xxs-9, .col-xxs-10, .col-xxs-11, .col-xxs-12 {position: relative;min-height: 1px;padding-right: 15px;padding-left: 15px;float: left;}
.col-xxs-12 {width: 100%;}.col-xxs-11 {width: 91.66666667%;}.col-xxs-10 {width: 83.33333333%;}.col-xxs-9 {width: 75%;}.col-xxs-8 {width: 66.66666667%;}.col-xxs-7 {width: 58.33333333%;}.col-xxs-6 {width: 50%;}.col-xxs-5 {width: 41.66666667%;}.col-xxs-4 {width: 33.33333333%;}.col-xxs-3 {width: 25%;}.col-xxs-2 {width: 16.66666667%;}.col-xxs-1 {width: 8.33333333%;}
.col-xxs-pull-12 {right: 100%;}.col-xxs-pull-11 {right: 91.66666667%;}.col-xxs-pull-10 {right: 83.33333333%;}.col-xxs-pull-9 {right: 75%;}.col-xxs-pull-8 {right: 66.66666667%;}.col-xxs-pull-7 {right: 58.33333333%;}.col-xxs-pull-6 {right: 50%;}.col-xxs-pull-5 {right: 41.66666667%;}.col-xxs-pull-4 {right: 33.3333333