if(function_exists("register_options_page")){
register_options_page("Analytics");
register_options_page("Logos");
register_options_page("Redes Sociales");
register_options_page("Footer Icons");
register_options_page("Informacion de contacto");
}
// LOCALIZATION
define('TDOMAIN', 'Techo');
define('LANGUAGE_FOLDER', TEMPLATEPATH.'/languages');
load_theme_textdomain(TDOMAIN, LANGUAGE_FOLDER );
add_action( 'admin_init', 'my_remove_menu_pages' );
function my_remove_menu_pages() {
@remove_menu_page('link-manager.php');
@remove_menu_page('edit-comments.php');
@remove_menu_page('edit.php');
}
function change_posts_per_page($query) {
if(is_archive()){
switch($query->query_vars["post_type"]){
case "videos":
if($query->query_vars["paged"]==0){
$query->query_vars["posts_per_page"] = 7;
}else{
$query->query_vars["posts_per_page"] = 12;
}
break;
}
return $query;
}
}
add_filter('pre_get_posts', 'change_posts_per_page');
if( function_exists( 'register_field' ) )
{
register_field('YoutubeURL',dirname(__File__).'/plugins/acf_fields/youtubeurl.php');
}
/* Ocultar la versión de wordpress */
remove_action('wp_head', 'wp_generator');
/* Change logo of admin panel */
function my_custom_login_logo()
{ echo '
';
}
add_action('login_head', 'my_custom_login_logo');
/* Change link of logo */
function change_wp_login_url()
{
//echo bloginfo('url'); // OR ECHO YOUR OWN URL
}add_filter('login_headerurl', 'change_wp_login_url');
function change_wp_login_title()
{
//echo get_option('blogname'); // OR ECHO YOUR OWN ALT TEXT
}add_filter('login_headertitle', 'change_wp_login_title');
/* Thumbnails for the admin panel */
if ( !function_exists('AddThumbColumn') && function_exists('add_theme_support') ) {
// for post and page
add_theme_support('post-thumbnails', array( 'post', 'page' ) );
function AddThumbColumn($cols) {
$cols['thumbnail'] = __('Thumbnail');
return $cols;
}
function AddThumbValue($column_name, $post_id) {
$width = (int) 60;
$height = (int) 60;
if ( 'thumbnail' == $column_name ) {
// thumbnail of WP 2.9
$thumbnail_id = get_post_meta( $post_id, '_thumbnail_id', true );
// image from gallery
$attachments = get_children( array('post_parent' => $post_id, 'post_type' => 'attachment', 'post_mime_type' => 'image') );
if ($thumbnail_id)
$thumb = wp_get_attachment_image( $thumbnail_id, array($width, $height), true );
elseif ($attachments) {
foreach ( $attachments as $attachment_id => $attachment ) {
$thumb = wp_get_attachment_image( $attachment_id, array($width, $height), true );
}
}
if ( isset($thumb) && $thumb ) {
echo $thumb;
} else {
echo __('None');
}
}
}
// for posts
add_filter( 'manage_posts_columns', 'AddThumbColumn' );
add_action( 'manage_posts_custom_column', 'AddThumbValue', 10, 2 );
// for pages
add_filter( 'manage_pages_columns', 'AddThumbColumn' );
add_action( 'manage_pages_custom_column', 'AddThumbValue', 10, 2 );
}
/* Thumbnails para las imágenes de los posts */
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
}
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'massive-slide' , 1920, 522, true ); // imagen para slider home
add_image_size( 'stream-thumb' , 160, 160, true ); // imagen para slider home
add_image_size( 'home-thumb' , 180, 59, true ); // imagen para slider home
add_image_size( 'slide' , 660, 182, true ); // imagen para slider home
add_image_size( 'partner-logo' , 72, 50, true ); // imagen para logos footer
add_image_size( 'xxx' , 220, 136, true ); // imagen para ...
}
/* Cambia texto footer wordpress */
function custom_admin_footer() {
echo 'TECHO | UN TECHO PARA MI PAÍS';
}
add_filter('admin_footer_text', 'custom_admin_footer');
/* Ocultar entradas */
add_action('admin_menu' , 'ocultar_entradas');
function ocultar_entradas() {
global $menu;
unset($menu[5]);
}
/* Organizando el orden de los custom posts */
function custom_menu_order($menu_ord) {
if (!$menu_ord) return true;
return array(
'index.php', // this represents the dashboard link
'edit.php?post_type=opina', // blog
'edit.php?post_type=informate', // últimas noticias
'edit.php?post_type=videos', // Videos destacados
'edit.php?post_type=entupais', // Techo en tu país
'edit.php?post_type=comunicados', // Comunicados de prensa
);
}
add_filter('custom_menu_order', 'custom_menu_order');
add_filter('menu_order', 'custom_menu_order');
/* Blog / Sección Opina */
add_action( 'init', 'register_cpt_opina' );
function register_cpt_opina() {
$labels = array(
'name' => __( 'Opina', 'Techo' ),
'singular_name' => __( 'Opina', 'Techo' ),
'add_new' => __( 'Agregar post', 'Techo' ),
'add_new_item' => __( 'Agregar nuevo post', 'Techo' ),
'edit_item' => __( 'Editar post', 'Techo' ),
'new_item' => __( 'Nuevo post', 'Techo' ),
'view_item' => __( 'Ver posts', 'Techo' ),
'search_items' => __( 'Buscar posts', 'Techo' ),
'not_found' => __( 'No hay posts disponibles', 'Techo' ),
'not_found_in_trash' => __( 'No hay posts disponibles en la papelera', 'Techo' ),
'parent_item_colon' => __( 'Post principal', 'Techo' ),
'menu_name' => __( 'Opina', 'Techo' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'description' => 'Posts disponibles en Opina',
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions', 'post-formats', 'custom-fields', 'excerpt', ),
'taxonomies' => array( 'post_tag', 'category', 'page-category' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 1,
'menu_icon' => ''.get_bloginfo('template_directory').'/images/admin/admin-icon-opina.png',
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => array("slug" => "opina"), // Formato de permalinks
'capability_type' => 'post'
);
register_post_type( 'opina', $args );
}
/* Blog / Sección Informórmate */
add_action( 'init', 'register_cpt_informate' );
function register_cpt_informate() {
$labels = array(
'name' => __( 'Infórmate', 'Techo' ),
'singular_name' => __( 'Infórmate', 'Techo' ),
'add_new' => __( 'Agregar post', 'Techo' ),
'add_new_item' => __( 'Agregar nuevo post', 'Techo' ),
'edit_item' => __( 'Editar post', 'Techo' ),
'new_item' => __( 'Nuevo post', 'Techo' ),
'view_item' => __( 'Ver posts', 'Techo' ),
'search_items' => __( 'Buscar posts', 'Techo' ),
'not_found' => __( 'No hay posts disponibles', 'Techo' ),
'not_found_in_trash' => __( 'No hay posts disponibles en la papelera', 'Techo' ),
'parent_item_colon' => __( 'Post principal', 'Techo' ),
'menu_name' => __( 'Infórmate', 'Techo' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'description' => __('Posts disponibles en Infórmate','Techo'),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions' ),
'taxonomies' => array( 'post_tag', 'category', 'page-category' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 1,
'menu_icon' => ''.get_bloginfo('template_directory').'/images/admin/admin-icon-informate.png',
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => array("slug" => "informate"), // Formato de permalinks
'capability_type' => 'post'
);
register_post_type( 'informate', $args );
}
/* Blog / Sección Videos */
add_action( 'init', 'register_cpt_videos' );
function register_cpt_videos() {
$labels = array(
'name' => __( 'Videos', $video ),
'singular_name' => __( 'videos', 'video' ),
'add_new' => __( 'Agregar post', 'video' ),
'add_new_item' => __( 'Agregar nuevo post', 'video' ),
'edit_item' => __( 'Editar post', 'video' ),
'new_item' => __( 'Nuevo post', 'video' ),
'view_item' => __( 'Ver posts', 'video' ),
'search_items' => __( 'Buscar posts', 'video' ),
'not_found' => __( 'No hay posts disponibles', 'video' ),
'not_found_in_trash' => __( 'No hay posts disponibles en la papelera', 'video' ),
'parent_item_colon' => __( 'Post principal', 'video' ),
'menu_name' => __( 'Videos', 'video' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'description' => 'Posts disponibles en Videos',
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions'),
'taxonomies' => array( 'post_tag', 'category', 'page-category' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 1,
'menu_icon' => ''.get_bloginfo('template_directory').'/images/admin/admin-icon-videos.png',
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => array("slug" => "videos"), // Formato de permalinks
'capability_type' => 'post'
);
register_post_type( 'videos', $args );
}
/* Comunicados de prensa */
add_action( 'init', 'register_cpt_comunicados' );
function register_cpt_comunicados() {
$labels = array(
'name' => __( 'Comunicados de prensa', 'Techo' ),
'singular_name' => __( 'Comunicados de prensa', 'Techo' ),
'add_new' => __( 'Agregar comunicado', 'Techo' ),
'add_new_item' => __( 'Agregar nuevo comunicado', 'Techo' ),
'edit_item' => __( 'Editar comunicado', 'Techo' ),
'new_item' => __( 'Nuevo comunicado', 'Techo' ),
'view_item' => __( 'Ver comunicados', 'Techo' ),
'search_items' => __( 'Buscar comunicados', 'Techo' ),
'not_found' => __( 'No hay noticias disponibles', 'Techo' ),
'not_found_in_trash' => __( 'No hay comunicados disponibles en la papelera', 'Techo' ),
'parent_item_colon' => __( 'Comunicado principal', 'Techo' ),
'menu_name' => __( 'Comunicados de prensa', 'Techo' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => false,
'description' => __('Posts disponibles en Comunicados de prensa','Techo'),
'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'revisions'),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 1,
'menu_icon' => ''.get_bloginfo('template_directory').'/images/admin/admin-icon-comunicados.png',
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => array("slug" => "comunicados-de-prensa"), // Formato de permalinks
'capability_type' => 'post'
);
register_post_type( 'comunicados', $args );
}
add_action( 'init', 'create_slider_post_type' );
function create_slider_post_type() {
global $image_sizes;
register_post_type( 'slide',
array(
'labels' => array(
'menu_name' => __('Slides','Techo'),
'name' => __( 'Slides','Techo'),
'singular_name' => __( 'slide','Techo'),
'add_new' => __("Agregar slide",'Techo'),
'edit_item' => __("Editar slide",'Techo'),
'view_item' => __("Ver slide",'Techo'),
'add_new_item' => __("Agregar slide",'Techo')
),
'public' => true,
'has_archive' => false,
'supports' => array("title"),
'rewrite' => false,
'query_var' => false
)
);
//add_image_size_wrapper( "home_slide", 940, 370, true );
}
function the_page_link($id,$format = '%s' ){
//$page = get_page($id);
printf ($format,get_permalink($id),get_the_title($id));
}
/**
* This plugin will fix a 404 error when viewing a paginated category listing of
* a custom post type when the custom permalink string is /%category%/%postname%/
* The problem is the request only checks for items with the 'post' type
* To fix the problem, add custom post types to the request
*/
function fix_category_pagination($qs){
if(isset($qs['category_name']) && isset($qs['paged'])){
$qs['post_type'] = get_post_types($args = array(
'public' => true,
'_builtin' => false
));
array_push($qs['post_type'],'post');
}
return $qs;
}
add_filter('request', 'fix_category_pagination');
/*Quitar mensaje de actualización */
# 2.8 to 3.0:
remove_action( 'wp_version_check', 'wp_version_check' );
remove_action( 'admin_init', '_maybe_update_core' );
add_filter( 'pre_transient_update_core', create_function( '$a', "return null;" ) );
# 3.0:
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
/* Quitar mensaje de actualización de plugins */
# 2.8 to 3.0:
remove_action( 'load-plugins.php', 'wp_update_plugins' );
remove_action( 'load-update.php', 'wp_update_plugins' );
remove_action( 'admin_init', '_maybe_update_plugins' );
remove_action( 'wp_update_plugins', 'wp_update_plugins' );
add_filter( 'pre_transient_update_plugins', create_function( '$a', "return null;" ) );
# 3.0:
remove_action( 'load-update-core.php', 'wp_update_plugins' );
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
function is_children_of($parent_id){
global $post;
if(is_page()){
if(intVal($post->post_parent)==$parent_id){
return true;
}else{
return false;
}
}else{
return false;
}
}
/**
* Activar Add-ons
* Aquí puedes introducir tus códigos de activación para desbloquear Add-ons y utilizarlos en tu tema.
* Ya que todos los códigos de activación tiene licencia multi-site, se te permite incluir tu clave en temas premium.
* Utiliza el código comentado para actualizar la base de datos con tu código de activación.
* Puedes colocar este código dentro de una instrucción IF para que sólo funcione en la activación del tema.
*/
if(!get_option('acf_repeater_ac')) update_option('acf_repeater_ac', "QJF7-L4IX-UCNP-RF2W");
if(!get_option('acf_options_page_ac')) update_option('acf_options_page_ac', "OPN8-FA4J-Y2LW-81LS");
// if(!get_option('acf_flexible_content_ac')) update_option('acf_flexible_content_ac', "xxxx-xxxx-xxxx-xxxx");
/**
* Registrar field groups
* La función register_field_group acepta un 1 array que contiene los datos pertinentes para registrar un Field Group
* Puedes editar el array como mejor te parezca. Sin embargo, esto puede dar lugar a errores si la matriz no es compatible con ACF
* Este código debe ejecutarse cada vez que se lee el archivo functions.php
*/
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => '4ff5fc3c86d4d',
'title' => __('Slides','Techo'),
'fields' =>
array (
0 =>
array (
'key' => 'field_4fcbe18238d41',
'label' => __('URL Destino','Techo'),
'name' => 'target_url',
'type' => 'text',
'instructions' => __('URL de destino. Dejar vacío si no debe llevar a ninguna parte.','Techo'),
'required' => '0',
'default_value' => '',
'formatting' => 'none',
'order_no' => '0',
),
1 =>
array (
'key' => 'field_4fcbe18239004',
'label' => 'Imagen',
'name' => 'slide_image',
'type' => 'image',
'instructions' => __('La imagen debe ser de al menos 1920 pixeles de ancho, y 522 pixeles de alto.','Techo'),
'required' => '1',
'save_format' => 'id',
'preview_size' => 'large',
'order_no' => '1',
),
/* 2 =>
array (
'label' => 'Imagen EN',
'name' => 'slide_image_en',
'type' => 'image',
'instructions' => __('Imagen en Inglés. La imagen debe ser de al menos 1920 pixeles de ancho, y 522 pixeles de alto.','Techo'),
'required' => '0',
'save_format' => 'id',
'preview_size' => 'medium',
'key' => 'field_4fd7685b659b9',
'order_no' => '2',
), */
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'slide',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ff5fc3c87110',
'title' => 'Videos',
'fields' =>
array (
0 =>
array (
'key' => 'field_4fcce71001875',
'label' => __('URL YouTube','Techo'),
'name' => 'url_youtube',
'type' => 'youtubeurl',
'instructions' => '',
'required' => '1',
'default_value' => '',
'order_no' => '0',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'videos',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ff5fc3c873f2',
'title' => __('Comunicados de prensa','Techo'),
'fields' =>
array (
0 =>
array (
'label' => __('Archivo','Techo'),
'name' => 'archivo',
'type' => 'file',
'instructions' => __('Suba el archivo a descargar','Techo'),
'required' => '1',
'save_format' => 'url',
'key' => 'field_4fce37c3c7251',
'order_no' => '0',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'post_type',
'operator' => '==',
'value' => 'comunicados',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ff740f487d88',
'title' => 'Redes Sociales',
'fields' =>
array (
0 =>
array (
'key' => 'field_4ff601e51f5c2',
'label' => __('Perfil Facebook','Techo'),
'name' => 'facebook_profile',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'https://www.facebook.com/pages/Techo/79616214317',
'formatting' => 'none',
'order_no' => '0',
),
1 =>
array (
'key' => 'field_4ff60236d6b5c',
'label' => __('Perfil Twitter','Techo'),
'name' => 'twitter_profile',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'http://twitter.com/UnTecho',
'formatting' => 'none',
'order_no' => '1',
),
2 =>
array (
'key' => 'field_4ff7053833b86',
'label' => __('Usuario de Twitter','Techo'),
'name' => 'twitter_user',
'type' => 'text',
'instructions' => __('Nombre de usuario de Twitter, para el widget que muestra los últimos tweets. (sin @)','Techo'),
'required' => '1',
'default_value' => 'UnTecho',
'formatting' => 'none',
'order_no' => '2',
),
3 =>
array (
'key' => 'field_4ff60236d6dea',
'label' => __('Perfil Flickr','Techo'),
'name' => 'flickr_profile',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'http://www.flickr.com/photos/untechoparamipais/',
'formatting' => 'none',
'order_no' => '3',
),
4 =>
array (
'key' => 'field_4ff60308e0bb2',
'label' => __('Perfil Youtube','Techo'),
'name' => 'youtube_profile',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'http://www.youtube.com/user/untechoparamipais?feature=watch',
'formatting' => 'none',
'order_no' => '4',
),
5 =>
array (
'key' => 'field_4ff60308e0e52',
'label' => __('Perfil LinkedIn','Techo'),
'name' => 'linkedin_profile',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'http://www.linkedin.com/groups?gid=1118117&mostPopular=&trk=tyah',
'formatting' => 'none',
'order_no' => '5',
),
6 =>
array (
'key' => 'field_4ff60308e10b9',
'label' => __('Perfil Google+','Techo'),
'name' => 'gplus_profile',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'https://plus.google.com/u/0/b/107548780184278756211/107548780184278756211/posts',
'formatting' => 'none',
'order_no' => '6',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'Redes Sociales',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ff740f488420',
'title' => __('Footer icons','Techo'),
'fields' =>
array (
0 =>
array (
'key' => 'field_4ff60b04c5d3f',
'label' => __('Socios Estratégicos','Techo'),
'name' => 'strategic_partners',
'type' => 'repeater',
'instructions' => __('URL opcional, imágenes de 72 x 50 px, fondo blanco.'),
'required' => '0',
'sub_fields' =>
array (
0 =>
array (
'key' => 'field_4ff60b04c5d91',
'label' => __('Nombre','Techo'),
'name' => 'name',
'type' => 'text',
'default_value' => '',
'formatting' => 'none',
'order_no' => '0',
),
1 =>
array (
'key' => 'field_4ff60b04c5dd6',
'label' => __('Imagen','Techo'),
'name' => 'image',
'type' => 'image',
'save_format' => 'id',
'preview_size' => 'thumbnail',
'order_no' => '1',
),
2 =>
array (
'label' => 'URL',
'name' => 'url',
'type' => 'text',
'default_value' => '',
'formatting' => 'none',
'key' => 'field_4ff7117b0ff10',
'order_no' => '2',
),
),
'row_limit' => '',
'layout' => 'table',
'button_label' => 'Agregar icono',
'order_no' => '0',
),
1 =>
array (
'key' => 'field_4ff60da9703b8',
'label' => __('Alianzas Corporativas Regionales','Techo'),
'name' => 'regional_alliances',
'type' => 'repeater',
'instructions' => __('URL opcional, imágenes de 72 x 50 px, fondo blanco.'),
'required' => '0',
'sub_fields' =>
array (
0 =>
array (
'key' => 'field_4ff60b04c5d91',
'label' => __('Nombre','Techo'),
'name' => 'name',
'type' => 'text',
'default_value' => '',
'formatting' => 'none',
'order_no' => '0',
),
1 =>
array (
'key' => 'field_4ff60b04c5dd6',
'label' => __('Imagen','Techo'),
'name' => 'image',
'type' => 'image',
'save_format' => 'id',
'preview_size' => 'thumbnail',
'order_no' => '1',
),
2 =>
array (
'label' => 'URL',
'name' => 'url',
'type' => 'text',
'default_value' => '',
'formatting' => 'none',
'key' => 'field_4ff7117b1038f',
'order_no' => '2',
),
),
'row_limit' => '',
'layout' => 'table',
'button_label' => __('Agregar icono','Techo'),
'order_no' => '1',
),
2 =>
array (
'key' => 'field_4ff60dfa168b9',
'label' => __('Organismos y organizaciones asociadas','Techo'),
'name' => 'associated_organizations',
'type' => 'repeater',
'instructions' => __('URL opcional, imágenes de 72 x 50 px, fondo blanco.'),
'required' => '0',
'sub_fields' =>
array (
0 =>
array (
'key' => 'field_4ff60b04c5d91',
'label' => __('Nombre','Techo'),
'name' => 'name',
'type' => 'text',
'default_value' => '',
'formatting' => 'none',
'order_no' => '0',
),
1 =>
array (
'key' => 'field_4ff60b04c5dd6',
'label' => __('Imagen','Techo'),
'name' => 'image',
'type' => 'image',
'save_format' => 'id',
'preview_size' => 'thumbnail',
'order_no' => '1',
),
2 =>
array (
'label' => 'URL',
'name' => 'url',
'type' => 'text',
'default_value' => '',
'formatting' => 'none',
'key' => 'field_4ff7117b10842',
'order_no' => '2',
),
),
'row_limit' => '',
'layout' => 'table',
'button_label' => __('Agregar icono','Techo'),
'order_no' => '2',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'Footer Icons',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ff740f488801',
'title' => __('Información de contacto','Techo'),
'fields' =>
array (
0 =>
array (
'key' => 'field_4ff616cac62a1',
'label' => __('Dirección','Techo'),
'name' => 'address',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'Departamental #440, San Joaquín, Santiago, Chile.',
'formatting' => 'none',
'order_no' => '0',
),
1 =>
array (
'key' => 'field_4ff616cac6545',
'label' => __('Teléfono','Techo'),
'name' => 'phone',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => '(56) (2) 838 73 00',
'formatting' => 'none',
'order_no' => '1',
),
2 =>
array (
'key' => 'field_4ff616cac678c',
'label' => __('Email','Techo'),
'name' => 'email',
'type' => 'text',
'instructions' => '',
'required' => '1',
'default_value' => 'info@techo.org',
'formatting' => 'none',
'order_no' => '2',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'Informacion de contacto',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ff740f488b61',
'title' => 'Logos',
'fields' =>
array (
0 =>
array (
'label' => __('Logo header','Techo'),
'name' => 'header_logo',
'type' => 'image',
'instructions' => __('El logo que aparecerá en la cabecera del sitio. Especificaciones: 348 x 180 px, PNG transparente.','Techo'),
'required' => '1',
'save_format' => 'url',
'preview_size' => 'full',
'key' => 'field_4ff70d2fce2c7',
'order_no' => '0',
),
1 =>
array (
'label' => __('Logo footer','Techo'),
'name' => 'footer_logo',
'type' => 'image',
'instructions' => __('El logo que aparecerá en el pie de página del sitio. Especificaciones: 133 x 50 px, PNG transparente.','Techo'),
'required' => '1',
'save_format' => 'url',
'preview_size' => 'full',
'key' => 'field_4ff70d2fce5d5',
'order_no' => '1',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'Logos',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ffc8390dc8fb',
'title' => 'Avanzado: Facebook',
'fields' =>
array (
0 =>
array (
'label' => 'Facebook app. ID',
'name' => 'fb_app_id',
'type' => 'text',
'instructions' => __('Para moderación de comentarios vía Facebook. Cualquier usuario listado como administrador bajo esta aplicación podrá moderar los comentarios.','Techo'),
'required' => '1',
'default_value' => '145743818893636',
'formatting' => 'none',
'key' => 'field_4ffb007059e9f',
'order_no' => '0',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'Redes Sociales',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
register_field_group(array (
'id' => '4ffc8390dcc27',
'title' => 'Google Analytics',
'fields' =>
array (
0 =>
array (
'key' => 'field_4ffb0191442cf',
'label' => __('Identificador de cuenta','Techo'),
'name' => 'google_analytics_id',
'type' => 'text',
'instructions' => __('Identificador de cuenta de Google Analytics. En google.com/analytics bajo la pestaña "Administrador" aparece bajo el nombre de "ID de propiedad:". Ej: UA-32398710-1','Techo'),
'required' => '1',
'default_value' => 'UA-32398710-1',
'formatting' => 'none',
'order_no' => '0',
),
),
'location' =>
array (
'rules' =>
array (
0 =>
array (
'param' => 'options_page',
'operator' => '==',
'value' => 'Analytics',
'order_no' => '0',
),
),
'allorany' => 'all',
),
'options' =>
array (
'position' => 'normal',
'layout' => 'default',
'hide_on_screen' =>
array (
),
),
'menu_order' => 0,
));
}
/* Incluir jQuery */
function wptuts_scripts_load_cdn()
{
// Deregister the included library
wp_deregister_script( 'jquery' );
// Register the library again from Google's CDN
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', array(), null, false );
// Register the script like this for a theme:
// wp_register_script( 'custom-script', get_template_directory_uri() . '/js/custom-script.js', array( 'jquery' ) );
// For either a plugin or a theme, you can then enqueue the script:
// wp_enqueue_script( 'custom-script' );
}
add_action( 'wp_enqueue_scripts', 'wptuts_scripts_load_cdn' );
?>