This file contains hidden or 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 | |
| /** | |
| * Template part for displaying posts | |
| * | |
| * @link https://developer.wordpress.org/themes/basics/template-hierarchy/ | |
| * | |
| * @package ddhub | |
| */ | |
| /** |
This file contains hidden or 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
| /* Agregar configuración de GraphQL */ | |
| add_action( 'graphql_register_types', function() { | |
| register_graphql_field( 'Post', 'nombreDelPersonaje', [ | |
| 'type' => 'String', | |
| 'description' => 'Campo Película de SCF', | |
| 'resolve' => function( $post ) { | |
| // Funciona con SCF porque SCF emula ACF | |
| return get_field('nombre_del_personaje', $post->ID); | |
| // o alternativamente: return get_post_meta($post->ID, 'pelicula', true); |
This file contains hidden or 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
| // tu función GraphQL | |
| function getPeliculasGraph(token) { | |
| const query = ` | |
| query { | |
| posts { | |
| nodes { | |
| title | |
| pelicula | |
| } | |
| } |
This file contains hidden or 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
| // FUNCIÓN PARA OBTENER EL TOKEN | |
| fetch('http://localhost:8888/wp-headless/wordpress/wp-json/jwt-auth/v1/token', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({ | |
| username: 'admin', | |
| password: 'admin123' | |
| }) | |
| }) |
This file contains hidden or 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
| /** AGREGAR CONFIGURACIÓN DE SECURE CUSTOM FIELDS */ | |
| add_action( 'graphql_register_types', function() { | |
| register_graphql_field( 'Post', 'pelicula', [ | |
| 'type' => 'String', | |
| 'description' => 'Campo Película de SCF', | |
| 'resolve' => function( $post ) { | |
| // Funciona con SCF porque SCF emula ACF | |
| return get_field('pelicula', $post->ID); | |
| // o alternativamente: return get_post_meta($post->ID, 'pelicula', true); |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-LN+7fdVzj6u52u30Kp6M/trliBMCMKTyK833zpbD+pXdCLuTusPj697FH4R/5mcr" crossorigin="anonymous"> | |
| <style> | |
| .card img { | |
| object-fit: contain; |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Document</title> | |
| <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.7/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-LN+7fdVzj6u52u30Kp6M/trliBMCMKTyK833zpbD+pXdCLuTusPj697FH4R/5mcr" crossorigin="anonymous"> | |
| <style> | |
| .card img { | |
| object-fit: contain; |
This file contains hidden or 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
| <meta property="og:title" content="El título de su página aquí" /> | |
| <meta property="og:type" content="website" /> | |
| <meta property="og:URL" content="https://www.tudominio.com" /> |
This file contains hidden or 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
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-12 my-5"> | |
| <h1>Profesionales de la V región</h1> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col-4"> | |
| <div class="card p-4 text-center" itemscope itemtype="https://schema.org/Person"> | |
| <img src="https://avatar.iran.liara.run/public/job/doctor/female" class="card-img-top" alt=""> |
This file contains hidden or 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
| <div class="container"> | |
| <div class="row"> | |
| <div class="col-12 my-5"> | |
| <h1>Profesionales de la V región</h1> | |
| </div> | |
| </div> | |
| <div class="row"> | |
| <div class="col-4"> | |
| <div class="card p-4 text-center"> | |
| <img src="https://avatar.iran.liara.run/public/job/doctor/female" class="card-img-top" alt="..."> |
NewerOlder