first commit

This commit is contained in:
2025-07-29 09:01:20 +00:00
commit f4f413ec23
1030 changed files with 79958 additions and 0 deletions

82
actualidad.php Normal file
View File

@ -0,0 +1,82 @@
<?php
global $params;
//~ global $paged;
//~ if (!isset($paged) || !$paged){ $paged = 1; }
$context = Timber::get_context();
$templates = array('actualidad.twig');
$mainargs = array(
'post_type' => 'post',
'post_status' => 'publish',
'numberposts' => 1,
'orderby' => array(
'date' => 'DESC'
),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
//~ 'terms' => array (29,32,64,30,36,38,40,33,37),
'terms' => array (29,141,30,139,37,140,138,32,36,38,40,33),
'operator' => 'NOT IN',
//'terms' => array (1), //Noticias
//'terms' => array (45), //Portada
)
),
);
$args = array(
'post_type' => 'post',
'post_status' => 'publish',
'offset' => 1,
'numberposts' => 50,
'orderby' => array(
'date' => 'DESC'
),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
//~ 'terms' => array (29,32,64,30,36,38,40,33,37),
'terms' => array (29,141,30,139,37,140,138,32,36,38,40,33),
'operator' => 'NOT IN',
)
),
);
// Configuración con offset dinamico
//~ $args = array(
//~ 'post_type' => 'post',
//~ 'post_status' => 'publish',
//~ 'posts_per_page' => 3,
//~ 'paged' => $paged,
//~ 'orderby' => array(
//~ 'date' => 'DESC'
//~ ),
//~ );
//~ codex.wordpress.org/Making_Custom_Queries_using_Offset_and_Pagination
//~ add_action('pre_get_posts', 'actualidad_query_offset', 1 );
//~ function actualidad_query_offset(&$args) {
//~ $offset = 1;
//~ $posts_per_page = 3;
//~ if ( $args->is_paged ) {
//~ $page_offset = $offset + ( ($args->query_vars['paged']-1) * $posts_per_page );
//~ $args->set('offset', $page_offset );
//~ }
//~ else {
//~ $args->set('offset',$offset);
//~ }
//~ }
$context['posts'] = new Timber\PostQuery($args);
$context['mainpost'] = new Timber\PostQuery($mainargs);
$context['section_title'] = 'actualidad';
//~ $context['pagination'] = Timber::get_pagination();
Timber::render( $templates, $context );

11
composer.json Normal file
View File

@ -0,0 +1,11 @@
{
"require": {
"tightenco/collect": "^7.5",
"twig/twig": "2.12.5",
"gregwar/formidable": "^2.1",
"rmccue/requests": "^1.7"
},
"require-dev": {
"agencearcange/wp-twig-dump": "^1.1"
}
}

652
composer.lock generated Normal file
View File

@ -0,0 +1,652 @@
{
"_readme": [
"This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b41f6e3517249ce761847b8c33b3809d",
"packages": [
{
"name": "gregwar/cache",
"version": "v1.0.12",
"target-dir": "Gregwar/Cache",
"source": {
"type": "git",
"url": "https://github.com/Gregwar/Cache.git",
"reference": "305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Gregwar/Cache/zipball/305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3",
"reference": "305d0f5a12c0beecbbd7e1de236f59f39e0c0ac3",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"type": "library",
"autoload": {
"psr-0": {
"Gregwar\\Cache": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gregwar",
"email": "g.passault@gmail.com"
}
],
"description": "A lightweight file-system cache system",
"keywords": [
"cache",
"caching",
"file-system",
"system"
],
"time": "2016-09-23T08:16:04+00:00"
},
{
"name": "gregwar/formidable",
"version": "2.1.0",
"target-dir": "Gregwar/Formidable",
"source": {
"type": "git",
"url": "https://github.com/Gregwar/Formidable.git",
"reference": "b1a63d96b5f52b1e8d5b094ee5b861f880469998"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Gregwar/Formidable/zipball/b1a63d96b5f52b1e8d5b094ee5b861f880469998",
"reference": "b1a63d96b5f52b1e8d5b094ee5b861f880469998",
"shasum": ""
},
"require": {
"gregwar/cache": "~1.0.9",
"php": ">=5.6",
"symfony/property-access": "~2.8.0"
},
"require-dev": {
"gregwar/captcha": "~1.1.6",
"phpunit/phpunit": "~4.8.9"
},
"suggest": {
"gregwar/captcha": "To implement Captcha capability into forms"
},
"type": "library",
"autoload": {
"psr-0": {
"Gregwar\\Formidable": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Grégoire Passault",
"email": "g.passault@gmail.com",
"homepage": "http://www.gregwar.com/"
},
{
"name": "Ashley Kitson aka chippyash",
"email": "info@zf4.biz",
"homepage": "http://zf4.biz"
}
],
"description": "Formidable, the pragmatic forms library",
"homepage": "https://gregwar.com/Formidable/",
"keywords": [
"Forms",
"fields",
"html",
"input"
],
"time": "2018-05-17T19:22:38+00:00"
},
{
"name": "rmccue/requests",
"version": "v1.7.0",
"source": {
"type": "git",
"url": "https://github.com/rmccue/Requests.git",
"reference": "87932f52ffad70504d93f04f15690cf16a089546"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rmccue/Requests/zipball/87932f52ffad70504d93f04f15690cf16a089546",
"reference": "87932f52ffad70504d93f04f15690cf16a089546",
"shasum": ""
},
"require": {
"php": ">=5.2"
},
"require-dev": {
"requests/test-server": "dev-master"
},
"type": "library",
"autoload": {
"psr-0": {
"Requests": "library/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"ISC"
],
"authors": [
{
"name": "Ryan McCue",
"homepage": "http://ryanmccue.info"
}
],
"description": "A HTTP library written in PHP, for human beings.",
"homepage": "http://github.com/rmccue/Requests",
"keywords": [
"curl",
"fsockopen",
"http",
"idna",
"ipv6",
"iri",
"sockets"
],
"time": "2016-10-13T00:11:37+00:00"
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"reference": "4719fa9c18b0464d399f1a63bf624b42b6fa8d14",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-ctype": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Ctype\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Gert de Pagter",
"email": "BackEndTea@gmail.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for ctype functions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"ctype",
"polyfill",
"portable"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-02-27T09:26:54+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.15.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"reference": "81ffd3a9c6d707be22e3012b827de1c9775fc5ac",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"suggest": {
"ext-mbstring": "For best performance"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.15-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Polyfill\\Mbstring\\": ""
},
"files": [
"bootstrap.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill for the Mbstring extension",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"mbstring",
"polyfill",
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-03-09T19:04:49+00:00"
},
{
"name": "symfony/property-access",
"version": "v2.8.52",
"source": {
"type": "git",
"url": "https://github.com/symfony/property-access.git",
"reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/c8f10191183be9bb0d5a1b8364d3891f1bde07b6",
"reference": "c8f10191183be9bb0d5a1b8364d3891f1bde07b6",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/polyfill-ctype": "~1.8"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.8-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Component\\PropertyAccess\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony PropertyAccess Component",
"homepage": "https://symfony.com",
"keywords": [
"access",
"array",
"extraction",
"index",
"injection",
"object",
"property",
"property path",
"reflection"
],
"time": "2018-11-11T11:18:13+00:00"
},
{
"name": "symfony/var-dumper",
"version": "v5.0.7",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "f74a126acd701392eef2492a17228d42552c86b5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/f74a126acd701392eef2492a17228d42552c86b5",
"reference": "f74a126acd701392eef2492a17228d42552c86b5",
"shasum": ""
},
"require": {
"php": "^7.2.5",
"symfony/polyfill-mbstring": "~1.0"
},
"conflict": {
"phpunit/phpunit": "<5.4.3",
"symfony/console": "<4.4"
},
"require-dev": {
"ext-iconv": "*",
"symfony/console": "^4.4|^5.0",
"symfony/process": "^4.4|^5.0",
"twig/twig": "^2.4|^3.0"
},
"suggest": {
"ext-iconv": "To convert non-UTF-8 strings to UTF-8 (or symfony/polyfill-iconv in case ext-iconv cannot be used).",
"ext-intl": "To show region name in time zone dump",
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
},
"bin": [
"Resources/bin/var-dump-server"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "5.0-dev"
}
},
"autoload": {
"files": [
"Resources/functions/dump.php"
],
"psr-4": {
"Symfony\\Component\\VarDumper\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony mechanism for exploring and dumping PHP variables",
"homepage": "https://symfony.com",
"keywords": [
"debug",
"dump"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-03-27T16:56:45+00:00"
},
{
"name": "tightenco/collect",
"version": "v7.5.0",
"source": {
"type": "git",
"url": "https://github.com/tightenco/collect.git",
"reference": "5024db45b1ec1956e6d5959cbb5cdf5f00f26f56"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tightenco/collect/zipball/5024db45b1ec1956e6d5959cbb5cdf5f00f26f56",
"reference": "5024db45b1ec1956e6d5959cbb5cdf5f00f26f56",
"shasum": ""
},
"require": {
"php": "^7.1.3",
"symfony/var-dumper": "^3.4 || ^4.0 || ^5.0"
},
"require-dev": {
"mockery/mockery": "^1.0",
"nesbot/carbon": "^2.23.0",
"phpunit/phpunit": "^7.0"
},
"type": "library",
"autoload": {
"files": [
"src/Collect/Support/helpers.php",
"src/Collect/Support/alias.php"
],
"psr-4": {
"Tightenco\\Collect\\": "src/Collect"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylorotwell@gmail.com"
}
],
"description": "Collect - Illuminate Collections as a separate package.",
"keywords": [
"collection",
"laravel"
],
"time": "2020-03-31T17:56:15+00:00"
},
{
"name": "twig/twig",
"version": "v2.12.5",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "18772e0190734944277ee97a02a9a6c6555fcd94"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/18772e0190734944277ee97a02a9a6c6555fcd94",
"reference": "18772e0190734944277ee97a02a9a6c6555fcd94",
"shasum": ""
},
"require": {
"php": "^7.0",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3"
},
"require-dev": {
"psr/container": "^1.0",
"symfony/phpunit-bridge": "^4.4|^5.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.12-dev"
}
},
"autoload": {
"psr-0": {
"Twig_": "lib/"
},
"psr-4": {
"Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Twig Team",
"role": "Contributors"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "https://twig.symfony.com",
"keywords": [
"templating"
],
"time": "2020-02-11T15:31:23+00:00"
}
],
"packages-dev": [
{
"name": "agencearcange/wp-twig-dump",
"version": "v1.1",
"source": {
"type": "git",
"url": "https://github.com/agencearcange/wp-twig-dump.git",
"reference": "d782ae81fe59f01578b97d3d526434c3879e90fe"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/agencearcange/wp-twig-dump/zipball/d782ae81fe59f01578b97d3d526434c3879e90fe",
"reference": "d782ae81fe59f01578b97d3d526434c3879e90fe",
"shasum": ""
},
"require": {
"hellonico/twig-dump-extension": "^1.0"
},
"type": "wordpress-muplugin",
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPLv2"
],
"description": "Allow dump() in twig templates",
"homepage": "https://github.com/agencearcange/arcange-wpdump",
"keywords": [
"plugin",
"timber",
"twig",
"wordpress"
],
"time": "2020-01-03T19:45:46+00:00"
},
{
"name": "hellonico/twig-dump-extension",
"version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/nlemoine/twig-dump-extension.git",
"reference": "a162573838ce18e7948b92a6eac74ff9db610639"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nlemoine/twig-dump-extension/zipball/a162573838ce18e7948b92a6eac74ff9db610639",
"reference": "a162573838ce18e7948b92a6eac74ff9db610639",
"shasum": ""
},
"require": {
"symfony/var-dumper": "^4.2 || ^5.0",
"twig/twig": "^2.4 || ^3.0"
},
"type": "library",
"autoload": {
"psr-4": {
"HelloNico\\Twig\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"GPL-3.0+"
],
"authors": [
{
"name": "Nicolas Lemoine",
"email": "dev@helloni.co",
"homepage": "https://github.com/nlemoine"
}
],
"description": "VarDumper Twig extension",
"homepage": "https://github.com/nlemoine/twig-dump-extension",
"time": "2020-03-06T15:18:29+00:00"
}
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"prefer-stable": false,
"prefer-lowest": false,
"platform": [],
"platform-dev": [],
"plugin-api-version": "1.1.0"
}

50
forms.php Normal file
View File

@ -0,0 +1,50 @@
<?php
include(__DIR__.'/vendor/autoload.php');
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
//~ $site->CONTACT_FORM = dirname( __FILE__ ).'/templates/solicita-presupuesto.html';
$compiled = Timber::compile( CONTACT_FORM, $context );
$subject_prefix = '[Presupuesto] ';
$form = new Gregwar\Formidable\Form($compiled);
$form->setLanguage(new Gregwar\Formidable\Language\Spanish);
$messages = array();
if ($form->posted()) {
if (count($form->check()) == 0) {
$subject = "";
$body = "\r\n";
$messages = ["Gracias por contactar!"];
$to = 'hola@estudionexos.com';
$subject = $subject_prefix.$form->subject;
$body = $body.$form->message."\r\n\r\n";
$body = $body.'Nombre'.$form->name."\r\n";
$body = $body.'Email'.$form->email."\r\n";
$body = $body.'Organizacion'.$form->organization."\r\n";
$body = $body.'Acepto las condiciones de <a href="/politica-de-privacidad">política de privacidad</a>'.$form->rgpd."\r\n";
$post = [
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => $body,
'post_title' => $subject,
'post_status' => 'private',
'post_type' => 'messages'
];
wp_insert_post( $post );
wp_mail( $to, $subject, $body );
} else {
$messages = $form->check();
}
}
$context['contactform'] = $form;
$context['messages'] = $messages;
$context['check'] = $form->check();
$context['posted'] = $form->posted();
$templates = array( 'contacto.twig' );
//~ if ( is_home() ) {
//~ array_unshift( $templates, 'page.twig' );
//~ }
Timber::render( $templates, $context );

139
functions.php Normal file
View File

@ -0,0 +1,139 @@
<?php
require_once(get_template_directory().'/app.php');
include(__DIR__ .'/vendor/autoload.php');
//~ use WeDevs\ORM\WP\Post as Post;
//~ composer require jgrossi/corcel
function create_team_type() {
$obj = new BaseCPT('team','Miembro del equipo');
$obj->menu_icon = 'dashicons-id-alt';
$obj->rewrite = array('slug' => 'equipo');
/*dump($obj->build_cpt());*/
register_post_type( $obj->slug, $obj->build_cpt() );
}
add_action( 'init', 'create_team_type' );
Routes::map('equipo/:slug', function($params){
$query = '';
Routes::load('team-member.php', $params, $query, 200);
});
Routes::map('actualidad', function($params){
$query = '';
Routes::load('actualidad.php', $params, $query, 200);
});
//~ Routes::map('actualidad/page/:page', function($params){
//~ $query = '';
//~ $params = [
//~ 'pg' => $params['page']
//~ ];
//~ $query = 'posts_per_page=3&paged='.intval($params['pg']);
//~ Routes::load('actualidad.php', $params, $query, 200);
//~ });
Routes::map('proyectos', function($params){
$query = '';
Routes::load('proyectos.php', $params, $query, 200);
});
// templatetag para rellenar con contenido dinamico la plantilla en desarollo
function frontpage_posts($numberposts=-1,$template_name='frontpage_post.twig') {
$args = [
'numberposts' => $numberposts,
'post_type' => 'post',
];
$ctx = ['posts' => Timber::get_posts( $args )];
return Timber::fetch($template_name, $ctx);
}
add_filter( 'timber/twig', function( \Twig_Environment $twig ) {
$twig->addFunction( new Timber\Twig_Function( 'frontpage_posts', 'frontpage_posts' ) );
return $twig;
} );
// fin del templatetag para rellenar con contenido dinamico la plantilla en desarollo
// Galeria
function andaira_gallery($attr) {
//~ $post = get_post();
//~ static $instance = 0;
//~ $instance++;
if ( ! empty( $attr['ids'] ) ) {
if ( empty( $attr['orderby'] ) ) {
$attr['orderby'] = 'post__in';
}
$attr['include'] = $attr['ids'];
$ids = explode(',', $attr['ids']);
}
$template_name='gallery.twig';
$medias = array();
$ids = explode(',', $attr['ids']);
for ($x=0;$x<count($ids); $x++) {
$media = new Timber\Image($ids[$x]);
array_push($medias, $media);
}
$ctx = array('medias' => $medias);
$tpl = Timber::fetch($template_name, $ctx);
return $tpl;
}
// Fin galeria
class AndairaSite extends StarterSite{
public $enable_ua = true;
function __construct() {
parent::__construct();
$this->recaptcha_url = 'https://www.google.com/recaptcha/api/siteverify';
$this->recaptcha_secret = '6Ldp7-cUAAAAALND-F6N211yRaam8jBF_W_jkzg_';
$this->recaptcha_public = '6Ldp7-cUAAAAANJ68d2DomQJn-TbnUxfVPNHm95K';
$this->CONTACT_FORM = dirname( __FILE__ ).'/templates/form_contact.html';
}
function add_to_context( $context ) {
$context = parent::add_to_context($context);
// Servicios
$svs = array(
'child_of' => 27,
'parent ' => 27,
'hierarchical' => 0,
'sort_column' => 'menu_order',
'sort_order' => 'asc',
'post_type' => 'page',
'post_status' => 'publish',
);
$servicios = get_pages( $svs );
$context['servicios'] = new Timber\PostQuery($servicios);
//return $context;
// Areas
$areas = get_terms( [
'taxonomy' => 'category',
'parent' => 29,
'hide_empty' => false,
]
);
//dump($areas);
$context['areas'] = $areas;
//Logotipos
$context['logotipo_cabecera'] = get_field('logotipo_cabecera', 'option');
return $context;
}
}
// Paginacion
$context['pagination'] = Timber::get_pagination();
// Galeria
add_shortcode('gallery', 'andaira_gallery');
$site = new AndairaSite();
//~ $site->main_menu_id = 2;
if (defined('WP_CLI') && WP_CLI) {require_once dirname(__FILE__).'/scripts/commands.php';}
?>

18
header.php Normal file
View File

@ -0,0 +1,18 @@
<?php
/**
* Third party plugins that hijack the theme will call wp_head() to get the header template.
* We use this to start our output buffer and render into the view/page-plugin.twig template in footer.php
*
* If you're not using a plugin that requries this behavior (ones that do include Events Calendar Pro and
* WooCommerce) you can delete this file and footer.php
*/
global $params;
$templates = array('header.twig');
$context = Timber::get_context();
//$GLOBALS['timberContext'] = Timber::get_context();
//ob_start();
Timber::render( $templates, $context );

1
index.php Normal file
View File

@ -0,0 +1 @@
<?php

60
page.php Normal file
View File

@ -0,0 +1,60 @@
<?php
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
$context['entries'] = Timber::get_posts('post_type = post');
//var_dump( Timber::get_posts('post_type = post'));
$templates = array( 'page-' . $post->post_name . '.twig', 'page.twig' );
//if ( is_front_page() ) {
// array_unshift( $templates, 'frontpage.twig' );
//}
// Areas de proyectos
$areas = get_terms( [
'taxonomy' => 'category',
'parent' => 29,
'hide_empty' => false,
]
);
$context['areas'] = $areas;
// Servicios
$serviciosterms = get_terms( [
'taxonomy' => 'category',
'parent' => 138,
'hide_empty' => false,
]
);
$context['serviciosterms'] = $serviciosterms;
// templatetag para filtrar los post con categorias de Servicios
function posts_by_service($numberposts=-1,$postslug,$slug,$template_name='posts_by_service.twig') {
$args = [
'numberposts' => $numberposts,
'post_type' => 'post',
'post_status' => 'publish',
'orderby' => array(
'date' => 'DESC'
),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'slug',
'terms' => array($postslug, $slug),
'operator' => 'AND',
)
),
];
$context = Timber::get_context();
$ctx = ['posts' => Timber::get_posts( $args ), 'areas' => $context['areas']];
return Timber::fetch($template_name, $ctx);
}
add_filter( 'timber/twig', function( \Twig_Environment $twig ) {
$twig->addFunction( new Timber\Twig_Function( 'posts_by_service', 'posts_by_service' ) );
return $twig;
} );
// fin del templatetag
Timber::render( $templates, $context );

65
proyectos.php Normal file
View File

@ -0,0 +1,65 @@
<?php
global $params;
$context = Timber::get_context();
$templates = array('proyectos.twig');
// Areas de proyectos
$areas = get_terms( [
'taxonomy' => 'category',
'parent' => 29,
'hide_empty' => false,
]
);
$context['areas'] = $areas;
// Servicios
$serviciosterms = get_terms( [
'taxonomy' => 'category',
'parent' => 138,
'hide_empty' => false,
]
);
$context['serviciosterms'] = $serviciosterms;
// Post por termino proyecto
$projects = array(
'post_type' => 'post',
'post_status' => 'publish',
'numberposts' => -1,
'orderby' => array(
'date' => 'DESC'
),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => 29,
'include_children' => false,
)
),
);
// Post por termino Consultoría en igualdad de género y gestión de la diversidad
$projects1 = array(
'post_type' => 'post',
'post_status' => 'publish',
'numberposts' => -1,
'orderby' => array(
'date' => 'DESC'
),
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'term_id',
'terms' => 32,
)
),
);
$context['posts'] = new Timber\PostQuery($projects);
$context['projects1'] = new Timber\PostQuery($projects1);
$context['section_title'] = 'proyectos';
Timber::render( $templates, $context );

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

BIN
public/img/check-circle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
public/img/coop57_logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

BIN
public/img/coop_logo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 322 KiB

BIN
public/img/demos_DEF.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

BIN
public/img/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
public/img/logo-alcala.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
public/img/logo-axa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

BIN
public/img/logo-cear.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
public/img/logo-central.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
public/img/logo-cimop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/img/logo-cocemfe.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

BIN
public/img/logo-ibdona.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

BIN
public/img/logo-lacaixa.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

BIN
public/img/logo-larueca.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
public/img/logo-misecam.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
public/img/logo-missem.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
public/img/logo-oecc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 489 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 544 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 KiB

BIN
public/img/reas_logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
public/img/right-arrow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
public/img/servicios.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 491 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
public/img/toggler.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Binary file not shown.

0
scripts/commands.php Normal file
View File

15
search.php Normal file
View File

@ -0,0 +1,15 @@
<?php
global $paged;
if (!isset($paged) || !$paged){
$paged = 1;
}
$templates = array( 'index.twig' );
$context = Timber::context();
$context['search_query'] = get_search_query();
$context['search_title'] = get_search_query();
$context['posts'] = new Timber\PostQuery();
$context['pagination'] = Timber::get_pagination();
Timber::render( $templates, $context );

66
single.php Normal file
View File

@ -0,0 +1,66 @@
<?php
/**
* The Template for displaying all single posts
*
* Methods for TimberHelper can be found in the /lib sub-directory
*
* @package WordPress
* @subpackage Timber
* @since Timber 0.1
*/
$context = Timber::get_context();
$post = new TimberPost();
$context['post'] = $post;
// Relacionados -> general
function get_related_posts($terms) {
$terms_query = array();
foreach($terms as $term) {
if ($term->term_id != 1) {
array_push($terms_query, $term->term_id);
}
}
$list_terms_ids = implode(',',$terms_query);
$args = array(
'post_type' => 'post',
'numberposts' => 3,
'tax_query' => array(
array(
'taxonomy' => 'category',
'field' => 'id',
'terms' => array($list_terms_ids),
'operator' => 'OR',
)
),
'post__not_in' => array( get_the_ID() )
);
return Timber::get_posts($args);
}
//~ $context = Timber::get_context();
//~ $post = Timber::query_post();
//~ $context['post'] = $post;
$context['related'] = get_related_posts($post->get_terms());
if ( post_password_required( $post->ID ) ) {
Timber::render( 'single-password.twig', $context );
} else {
Timber::render( array( 'single-' . $post->ID . '.twig', 'single-' . $post->post_type . '.twig', 'single.twig' ), $context );
}
//~ $timber_post = Timber::query_post();
//~ $context['post'] = $timber_post;
//~ $context['related'] = get_related_posts($timber_post->get_terms());
//~ if ( post_password_required( $timber_post->ID ) ) {
//~ Timber::render( 'single-password.twig', $context );
//~ } else {
//~ Timber::render( array( 'single-' . $timber_post->ID . '.twig', 'single-' . $timber_post->post_type . '.twig', 'single-' . $timber_post->slug . '.twig', 'single.twig' ), $context );
//~ }

74
site.js Normal file
View File

@ -0,0 +1,74 @@
// Menu effects
jQuery(document).scroll(function() {
var y = jQuery(this).scrollTop();
if (y > 100) {
jQuery('.front .navbar').removeClass('bg-transparent').addClass('bg-white');
jQuery('.front .navbar-brand').removeClass('d-none');
} else {
jQuery('.front .navbar').removeClass('bg-white').addClass('bg-transparent');
}
});
// Frontpage effects
jQuery(document).scroll(function() {
var y = jQuery(this).scrollTop();
if (y > 500) {
jQuery('#section-1-bis').addClass('pt-150');
} else {
jQuery('#section-1-bis').removeClass('pt-150');
}
});
jQuery(document).ready(function($) {
var scrollDown = $(".scrolldown-1"),
topElementHeight = 0,
elementItems = scrollDown.find("a"),
scrollItems = elementItems.map(function(){
var item = $($(this).attr("href"));
if (item.length) { return item; }
});
elementItems.click(function(e){
var href = $(this).attr("href"),
offsetTop = href === "#" ? 0 : $(href).offset().top-topElementHeight+1;
$('html, body').stop().animate({
scrollTop: offsetTop
}, 600);
e.preventDefault();
});
$('.carousel').carousel()
$('.embed-responsive iframe').addClass('embed-responsive-item')
// Calcular ancho columnas carrousel portada
//~ var colwidth = $( window ).width();
//~ if (colwidth <= 414) {
//~ $('#projectsSliderXs').removeClass('d-none');
//~ $('#projectsSliderMd').addClass('d-none');
//~ $('#projectsSliderLg').addClass('d-none');
//~ $('#frontpage-actualidad-xs').removeClass('d-none');
//~ $('#frontpage-actualidad-md').addClass('d-none');
//~ $('#frontpage-actualidad-lg').addClass('d-none');
//~ } else if (colwidth <= 1024) {
//~ $('#projectsSliderXs').addClass('d-none');
//~ $('#projectsSliderMd').removeClass('d-none');
//~ $('#projectsSliderLg').addClass('d-none');
//~ $('#frontpage-actualidad-xs').addClass('d-none');
//~ $('#frontpage-actualidad-md').removeClass('d-none');
//~ $('#frontpage-actualidad-lg').addClass('d-none');
//~ } else {
//~ $('#projectsSliderXs').addClass('d-none');
//~ $('#projectsSliderMd').addClass('d-none');
//~ $('#projectsSliderLg').removeClass('d-none');
//~ $('#frontpage-actualidad-xs').addClass('d-none');
//~ $('#frontpage-actualidad-md').addClass('d-none');
//~ $('#frontpage-actualidad-lg').removeClass('d-none');
//~ }
});

Some files were not shown because too many files have changed in this diff Show More