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 | |
/** | |
* Save latitude/longitude for display in a CMB field | |
* | |
* @author Phil Wylie | |
* @link http://link.from.pw/1ejMnDr | |
*/ | |
function pw_save_latitude_longitude( $entry, $form ) { | |
$latitude = $entry[3]; // where 3 is the field ID for latitude | |
$longitude = $entry[4]; // where 4 is the field ID for longitude |
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 | |
/** | |
* Filter the logo on the WordPress login page | |
*/ | |
function iweb_login_logo(){ | |
echo '<style type="text/css">h1 a {background-image:url(' . get_stylesheet_directory_uri() . '/logo.png' . ') !important; background-position: center center !important; background-size: auto !important; width: 265px !important; height: 80px !important;}</style>'; | |
} | |
add_filter( 'login_head', 'iweb_login_logo' ); | |
/** |
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 | |
/** | |
* Prevent Yoast SEO redirect 302 instead 404 on date archives | |
* | |
* @author Henry Ruhl | |
* @link http://goo.gl/s5d0Lo | |
*/ | |
function iweb_remove_pagination_overflow_redirect() { | |
remove_action( 'wp', array($GLOBALS['wpseo_front'], 'pagination_overflow_redirect'), 99 ); | |
} |
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 | |
/** | |
* Gets a number of terms and displays them as options | |
* | |
* Modified from CMB example code to save the term ID instead of slug. | |
* | |
* @link http://link.from.pw/1sLyqqv | |
* @param string $taxonomy Taxonomy terms to retrieve. Default is category | |
* @param string|array $args Optional. Change the defaults retrieving terms | |
* @return array An array of options that matches the CMB options 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 | |
/** | |
* Remove text colour button from editor | |
*/ | |
function iweb_remove_text_colour_button( $buttons ) { | |
if ( ( $key = array_search( 'forecolor', $buttons ) ) !== false ) { | |
unset( $buttons[$key] ); | |
} | |
return $buttons; |
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 | |
/* | |
Plugin Name: Simple Post List | |
Plugin URI: http://www.iwebcontrol.co.uk/ | |
Description: Simple plugin to output a list of blog post URLs. | |
Version: 1.0.0 | |
Author: Phil Wylie | |
Author URI: http://www.iwebcontrol.co.uk/ | |
License: GPLv2+ | |
*/ |
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 | |
/** | |
* Get the slug of your post or page | |
* | |
* @author Tom Barrett | |
* @link http://goo.gl/95boK0 | |
*/ | |
function iweb_get_the_slug( $id = null ) { | |
if ( empty( $id ) ) { | |
global $post; |
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 | |
/** | |
* Get a list of posts | |
* | |
* Generic function to return an array of posts formatted for CMB2. Simply pass | |
* in your WP_Query arguments and get back a beautifully formatted CMB2 options | |
* array. | |
* | |
* @param array $query_args WP_Query arguments | |
* @return array CMB2 options 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
# OS or IDE folders/files to ignore | |
*~ | |
._* | |
*.lock | |
*.DS_Store | |
*.swp | |
*.out | |
.cache | |
.project | |
.settings |
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 | |
/** | |
* Enable Jetpack Photon on HTTPS | |
* | |
* @author Jeremy Herve | |
* @link http://goo.gl/inSy5i | |
*/ | |
add_filter( 'jetpack_photon_reject_https', '__return_false' ); |
OlderNewer