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
/** | |
* Returns the given number of terms from the specified taxonomies (for the current post). | |
* | |
* @param (string|array) $taxonomies The taxonomy(es) to retrieve terms from | |
* @param (int) $term_number Limit the number of terms returned (-1 for no limit) | |
* @param (bool) $term_links Whether to return links to term archives or not | |
* @param (string) $separator String that will be used as the terms separarator | |
* @return (string) The list of taxonomy terms for the current post or empty string | |
*/ | |
function eo_get_tax_terms($taxonomies, $term_number = -1, $term_links = true, $separator = ', ') |
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
// taxonomy terms will be displayed after the post content (notice the priority of 50) | |
add_action ('genesis_post_content', 'eo_display_taxonomy_terms', 50); | |
function eo_display_taxonomy_terms() | |
{ | |
// replace with the slugs of your custom taxonomies | |
$taxonomy1 = 'taxonomy1'; | |
$taxonomy2 = 'taxonomy2'; | |
$other_taxonomies = array('taxonomy3', 'taxonomy4'); | |
// display all terms from the first taxonomy separated by commas, with each term linking to that term's archive page |
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 WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> | |
# END WordPress |
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) |
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
/** 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
/** 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
(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
/** 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> |