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 ); |
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
<?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 | |
//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
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 | |
//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
<?php | |
// ---------------------------------------------------------------------- | |
// ----------------------- Custom post status --------------------------- | |
// ---------------------------------------------------------------------- | |
// "premsa" es el post status | |
// "publicacio" el cpt asociado. | |
// Create a custom post status | |
function mafs_new_archive_post_status() { | |
register_post_status( 'premsa', array( |
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
<?php | |
function show_advanced_tools_bar_tiny_mce( $args ) { | |
$args['wordpress_adv_hidden'] = false; | |
return $args; | |
} | |
add_filter( 'tiny_mce_before_init', 'show_advanced_tools_bar_tiny_mce' ); |
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 | |
// Esta función permite imprimir el formulario adecuado dependiendo del idioma. | |
// Lo único que hay que tener en cuenta es que cuando creamos el título del formulario | |
// Hay que hacerlo siguiendo esta norma: "nombre del formulario" + " __" + slug del idioma. | |
// Ejemplo: ESP: "formulario __es", CAT: "formulario __ca", ENG: "formulario __en" | |
// En este ejemplo concreto, habría que llamar la función así: | |
// mafs_print_currentlang_form( 'formulario' ); | |
function mafs_print_currentlang_form( $form_name ) { |
OlderNewer