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
/** 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
<?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
/** Add Cloud Box scripts to footer */ | |
function eo_add_scripts_to_footer() { | |
wp_enqueue_script('jquery'); | |
wp_enqueue_script('jquery-scrolltofixed', get_stylesheet_directory_uri() . '/js/jquery-scrolltofixed-min.js', array('jquery'), '', true); | |
} | |
add_action('wp_enqueue_scripts', 'eo_add_scripts_to_footer'); | |
function eo_add_extra_script_to_footer() { | |
?> | |
<script> |
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(a){a.isScrollToFixed=function(b){return a(b).data("ScrollToFixed")!==undefined};a.ScrollToFixed=function(d,h){var k=this;k.$el=a(d);k.el=d;k.$el.data("ScrollToFixed",k);var c=false;var F=k.$el;var G;var D;var p;var C=0;var q=0;var i=-1;var e=-1;var t=null;var y;var f;function u(){F.trigger("preUnfixed.ScrollToFixed");j();F.trigger("unfixed.ScrollToFixed");e=-1;C=F.offset().top;q=F.offset().left;if(k.options.offsets){q+=(F.offset().left-F.position().left)}if(i==-1){i=q}G=F.css("position");c=true;if(k.options.bottom!=-1){F.trigger("preFixed.ScrollToFixed");w();F.trigger("fixed.ScrollToFixed")}}function m(){var H=k.options.limit;if(!H){return 0}if(typeof(H)==="function"){return H.apply(F)}return H}function o(){return G==="fixed"}function x(){return G==="absolute"}function g(){return !(o()||x())}function w(){if(!o()){t.css({display:F.css("display"),width:F.outerWidth(true),height:F.outerHeight(true),"float":F.css("float")});F.css({width:F.width(),position:"fixed",top:k.options.bottom==-1?s():"",bottom:k |
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
/** Modify the header URL */ | |
add_filter('genesis_seo_title', 'eo_set_header_url'); | |
function eo_set_header_url($title, $inside, $wrap) | |
{ | |
$blog_name = get_bloginfo('name'); | |
$header_url = user_trailingslashit('http://www.eugenoprea.com'); | |
$inside = sprintf('<a title="%s" href="%s">%s</a>', $header_url, esc_attr($blog_name), $blog_name); | |
$title = sprintf('<%1$s id="title">%2$s</%1$s>', $wrap, $inside); | |
return $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
/** Change Text Shown When No Posts Are Found */ | |
add_filter('genesis_noposts_text', 'eo_noposts_text'); | |
function eo_noposts_text($text) | |
{ | |
$text = '<span class="noposts-text">' . __('Your request did not return any results, please check back later.', 'eo') . '</span>'; | |
return $text; | |
} |
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 custom post class to posts in the "Featured" category | |
add_filter('post_class', 'eo_custom_post_class'); | |
function eo_custom_post_class($classes) | |
{ | |
$new_class = 'featured-post'; | |
if (in_category('Featured')) | |
$classes[] = esc_attr(sanitize_html_class($new_class)); | |
return $classes; | |
} |
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
// When true, the form will be saved to DB after dynamic population | |
define('EO_SAVE_FORM_ON_PRE_RENDER', true); | |
// Adds a filter to form id 7. Replace 26 with your actual form id | |
add_filter('gform_pre_render_7', 'eo_populate_checkbox'); | |
add_filter('gform_admin_pre_render_7', 'eo_populate_checkbox'); | |
function eo_populate_checkbox($form) { | |
if (EO_SAVE_FORM_ON_PRE_RENDER) |