Skip to content

Instantly share code, notes, and snippets.

@eclarrrk
eclarrrk / php-obfuscate-email-address
Last active May 25, 2018 13:00
How to obfuscate an email address in PHP
1. Remove link around email address.
2. Wrap email address in <div class="reverse"></div>
3. Reverse the email address using strrev() or similar.
////////// example code //////////
<div class="reverse">
<?php echo strrev($emailAddress); ?>
</div>
@eclarrrk
eclarrrk / nov-iframe-styles.txt
Last active July 21, 2017 17:23
Novara iframe form styles
iframe {
// remove "width: 600px" from element's inline style
}
form * {
box-sizing: border-box;
}
form table {
width: 100%;
}
.formContainer {
// Add additional image size.
// First parameter is name for image size. Second parameter is the image's width. Height is set proportionally
// After this is added to functions.php, when an image is uploaded, an additional image with the width of the size entered will be created, but will not appear in the media library. much like thumbnail images are.
// Only applys to images uploaded since this code is added. Use regenerate thumbnails plugin to apply this change to all media.
add_image_size('x-large-img', 1300);
/////////////////////////////////////////////////
<?php
$lastposts = get_posts( array(
'numberposts' => 99,
'post_type' => 'team_member')
);
if ( $lastposts ) {
foreach ( $lastposts as $post ) :
setup_postdata( $post );
<aside class="post-navigation bg-texture--light">
<?php
$next_post = get_next_post();
$prev_post = get_previous_post();
?>
<?php if ($prev_post) { ?>
<a href="<?php echo $prev_post->guid ?>" class="post-navigation__prev">
<div class="post-navigation__label">Previous story</div>
<div class="post-navigation__title">
<?php echo $prev_post->post_title ?>
@eclarrrk
eclarrrk / sample-page.html
Created October 5, 2016 19:33
Sample page for gh-pages demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Github Pages Sample Page</title>
<style media="screen">
.wrapper {
width: 80%;
padding: 20px 10% 0 10%;
background-color: #fff;