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 | |
/** | |
* Handles display of 404 page. | |
* | |
* Edited by Eugen Oprea - http://www.eugenoprea.com/ | |
* | |
* This file should be added in the directory of your child theme! | |
* | |
* @category Genesis | |
* @package Templates |
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
/** Exclude DiggDigg from specific pages */ | |
function eo_exclude_digg_digg() { | |
if(is_page(array(1, 2, 3, 4))) { | |
remove_filter('the_excerpt', 'dd_hook_wp_content'); | |
remove_filter('the_content', 'dd_hook_wp_content'); | |
} | |
} | |
add_action('template_redirect', 'eo_exclude_digg_digg'); |
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
function eo_get_usermeta($meta_key) | |
{ | |
$current_user = wp_get_current_user(); | |
$ret = (($current_user instanceof WP_User) && (0 != $current_user->ID)) ? | |
$current_user->__get($meta_key) : ''; | |
return $ret; | |
} |
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
first_name = eo_get_usermeta('first_name'); | |
last_name = eo_get_usermeta('last_name'); |
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
add_filter('gform_field_value_first_name', 'eo_populate_name'); | |
add_filter('gform_field_value_last_name', 'eo_populate_name'); | |
function eo_populate_name($value) | |
{ | |
// extract the parameter name from the current filter name | |
$param = str_replace('gform_field_value_', '', current_filter()); | |
// we are interested only in the first_name and last_name parameters | |
if ( !in_array($param, array('first_name', 'last_name')) ) |
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
/** | |
* Populate a Gravity Forms Name field. | |
* | |
* @param array $field Gravity Forms field object | |
* @param string|array $name Name components, pass either a string or array when the | |
* nameFormat is 'simple' or an array in all other cases | |
*/ | |
function eo_populate_name_field(&$field, $name = array()) | |
{ | |
if ( !(is_array($field) && ('name' == rgar($field, 'type')) && !empty($name)) ) |
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
// Adds a filter to form id 7. Replace 7 with your actual form id | |
add_filter('gform_pre_render_7', 'eo_form_pre_render'); | |
function eo_form_pre_render($form) | |
{ | |
// if no user is logged-in, do nothing | |
if ( !is_user_logged_in() ) | |
return $form; | |
foreach ($form['fields'] as &$field) |
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
/** Genesis Previous/Next Post Post Navigation */ | |
add_action( 'genesis_before_comments', 'eo_prev_next_post_nav' ); | |
function eo_prev_next_post_nav() { | |
if ( is_single() ) { | |
echo '<div class="prev-next-navigation">'; | |
previous_post_link( '<div class="previous">Previous article: %link</div>', '%title' ); |
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
# BEGIN redirect to homepage | |
RewriteEngine on | |
RewriteCond %{REQUEST_URI} !^/$ | |
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js|php)$ | |
RewriteCond %{REQUEST_URI} !^/wp-admin [NC] | |
RewriteRule .* / [L,R=301] | |
#END redirect to homepage |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Excluding traffic by Cookie Content</title> | |
<meta name=”robots” content=”noindex” /> |