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 | |
//Function that returns a string without accents | |
//source: http://stackoverflow.com/a/11743977/2841746 | |
function stripAccents($text_to_strip) { | |
return strtr(utf8_decode($text_to_strip), utf8_decode('àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ'), 'aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY'); | |
} | |
?> |
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
UPDATE wp_term_taxonomy tt | |
SET count = | |
(SELECT count(p.ID) FROM wp_term_relationships tr | |
LEFT JOIN wp_posts p | |
ON (p.ID = tr.object_id AND p.post_type = 'post_type_name' AND p.post_status = 'publish') | |
WHERE tr.term_taxonomy_id = tt.term_taxonomy_id | |
) |
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 | |
//do not add in opening php tag | |
/** | |
* Custom Genesis Home Loop with Character Limitation on Excerpt | |
* | |
* @package Custom Genesis Home Loop with Character Limitation on Excerpt | |
* @author Neil Gee | |
* @link http://wpbeaches.com | |
* @copyright (c)2014, Neil Gee |
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 | |
// First we include it in the genesis-structural-wrap genesis declaration | |
add_theme_support( 'genesis-structural-wraps', array( | |
'header', | |
// 'nav', | |
// 'subnav', | |
'site-inner', | |
'footer-widgets', | |
'page-header-img', //here is it | |
'footer' |
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 language switcher polylang with slug inspite of names | |
//* Position header-right | |
add_action( 'genesis_header_right', 'custom_language_switcher'); | |
function custom_language_switcher() { | |
echo '<ul class="custom-lang-switcher">'; | |
pll_the_languages(array('show_names'=>1,'display_names_as'=>'slug')); | |
echo '</ul>'; | |
} |
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 | |
/** | |
* Limit Search to Video | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/wordpress-search-post-type/ | |
* | |
* @param string search form | |
* @param string search text | |
* @param string button text | |
* @return string modified search form |
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 | |
// Buscar solo coincidencias en el titulo | |
// Source: http://www.paulund.co.uk/limit-wordpress-search-to-post-titles | |
function search_by_title_only( $search, &$wp_query ) | |
{ | |
global $wpdb; | |
if ( empty( $search ) ) | |
return $search; // skip processing - no search term in query | |
$q = $wp_query->query_vars; | |
$n = ! empty( $q['exact'] ) ? '' : '%'; |
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_action( 'get_header', 'themeprefix_cpt_microdata' ); | |
//Change microdata for events custom post type | |
function themeprefix_cpt_microdata() { | |
if ('event' == get_post_type()) {//change to your cpt | |
//add in the microdata changes | |
add_filter( 'genesis_attr_entry', 'themeprefix_genesis_attributes_entry', 20 ); |
NewerOlder