Skip to content

Instantly share code, notes, and snippets.

@maugelves
Created July 6, 2017 10:13
Show Gist options
  • Save maugelves/d2082ecd69145ca37b1dbae1b93b1b9a to your computer and use it in GitHub Desktop.
Save maugelves/d2082ecd69145ca37b1dbae1b93b1b9a to your computer and use it in GitHub Desktop.
Include ACF
<?php
// 1. Configurar el PATH hacia la nueva carpeta de ACF
function configurar_path_a_acf( $path ) {
// actualizar el path
$path = get_stylesheet_directory() . '/acf/';
return $path;
}
add_filter('acf/settings/path', 'configurar_path_a_acf');
// 2. Configurar el nuevo directorio de ACF
function configurar_directorio_acf( $dir ) {
// actualizar el directorio
$dir = get_stylesheet_directory_uri() . '/acf/';
return $dir;
}
add_filter('acf/settings/dir', 'configurar_directorio_acf');
// 3. (Opcional) Ocultar el menú de ACF en el administrador de WordPress
add_filter('acf/settings/show_admin', '__return_false');
// 4. Hacer el include de ACF
include_once( get_stylesheet_directory() . '/acf/acf.php' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment