SlideShare a Scribd company logo
1 of 24
echo ‘<h1>Crea Schemas sin plugins</h1>’;
echo ‘<h2>Por David Pérez</h2>’;
echo ‘<img src=“https://2020.chiclana.wordcamp.org/files/2019/12/
cropped-logo-WordCamp-Chiclana-2020.png" />’;
<?php
<?php
echo ‘<h1>Quien soy</h1>’;
/**
* @author David Pérez García
* @company Director Closemarketing
* @job Desarrollo y Marketing
*
* https://davidperezgar.com
* https://www.closemarketing.es
*
* @twitter davidperezmk
*
* @package WordPress
*
*/
<?php
echo ‘<h1>¿Qué son los Schemas?</h1>’;
echo ‘<ul>’;
echo ‘<li>Conjunto de etiquetas para describir nuestro contenido</li>’;
echo ‘<li>Ofrece semántica enriquecida para los buscadores</li>’;
echo ‘<li>Ayuda a entender y clasificar la información</li>’;
echo ‘<li>Podrá aparecer destacado en el buscador</li>’;
echo ‘</ul>’;
<?php
echo ‘<h1>Qué son los Schemas</h1>’;
echo ‘<ul>’;
echo ‘<li>Ejemplo de Schema para
películas.</li>’;
echo ‘<li>Resultados
diferenciados.</li>;
echo ‘</ul>’;
<?php
echo ‘<h1>Qué son los Schemas</h1>’;
echo ‘<p>Herramienta para Google Chrome para visualizar Schemas</p>’;
Descarga
<?php
echo ‘<h1>Qué son los Schemas</h1>’;
<?php
echo ‘¿Qué necesitaremos en WordPress?
echo ‘<ul>’;
echo ‘<li>Post Types / Entradas personalizadas</li>’;
echo ‘<li>Custom Fields / Variables personalizadas</li>’;
echo ‘</ul>’;
<?php
echo ‘Donde consultar’;
/**
*
* https://schema.org
*
*/
/**
* Directrices
* https://developers.google.com/search/docs/guides/sd-policies
*
*/
<?php
echo ‘Donde consultar’;
/**
* https://schema.org/docs/full.html
*/
1022
/**
* De los que hay…
*/
<?php
echo ‘Donde consultar’;
/**
*
* Tipos:
*
* Action
* CreativeWork
* Event
* Intangible
* MedicalEntity
* Organization
* Person
* Place
* Product
*
*
*
*/
<?php
echo ‘Recoger la información JSON+LD’;
<?php
echo ‘Donde ubicarlos’;
<?php
/**
* Plugin Name: Nombre del plugin
* Plugin URI: https://davidperezgar.com
* Description: Desarrollo realizado para entorno WordPress.
* Author: David
* Author URI: https://twitter.com/davidperezmk
* Version: 1.0
*
* @package WordPress
*/
// Schema
require_once plugin_dir_path( __FILE__ ) . '/schemas/organization.php';
archivo mu-plugins/functions.php
<?php
echo ‘Donde ubicarlos’;
<?php
/**
* Utilizar el Plugin Code Snippets
* Plugin URI: https://es.wordpress.org/plugins/code-snippets/
*/
<?php
echo ‘Donde colocar el Schema y Cómo subirlo’;
add_action( ‘wp_head’, ‘schema_organization’, 20 );
function schema_organization() {
if ( is_front_page() ) {
echo '
<script type="application/ld+json">
<?php
echo ‘Schema: Organización’;
add_action( 'wp_head', 'cmk_add_schema_home_page', 20 );
/**
* Shows Schema depeding of post type home_page in header with LD JSON
*
* @return void
*/
function cmk_add_schema_home_page() {
if ( is_front_page() || is_home() ) {
echo '
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"address": {
"@type": "PostalAddress",
"addressLocality": "Granada, España",
"postalCode": "18006",
"streetAddress": "Calle Jose Luis Pérez Pujadas, 6 Edificio Forum
Oficina B29"
},
"email": "info@closemarketing.es",
"url": "https://www.closemarketing.es/",
"description": "Agencia de Marketing Online, Diseñamos Web en
WordPress para Granada y Málaga.",
"taxID": "ESB19618909",
"employee": [
{
"@type": "Person",
"name": "David Pérez"
},
{
"@type": "Person",
"name": "Sacra Jáimez"
}
],
"member": [
{
"@type": "Organization",
"name": "AJE Granada"
},
{
"@type": "Organization",
"name": "WordPress Granada"
}
],
"name": "Closemarketing",
"telephone": "+34858958383"
}
</script>';
echo $sch;
} // home_page schema
}
<?php
echo ‘Schema: Organización’;
add_action( 'wp_head', 'cmk_add_schema_home_page', 20 );
/**
* Shows Schema depeding of post type home_page in header with
LD JSON
*
* @return void
*/
function cmk_add_schema_home_page() {
if ( is_front_page() || is_home() ) {
$sch = '
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Organization",
"address": {
"@type": "PostalAddress",
"addressLocality": "Granada, España",
"postalCode": "18006",
"streetAddress": "Calle Jose Luis Pérez Pujadas, 6
Edificio Forum Oficina B29"
},
"email": "info@closemarketing.es",
"url": "https://www.closemarketing.es/",
"description": "Agencia de Marketing Online, Diseñamos Web
en WordPress para Granada y Málaga.",
"taxID": "ESB19618909",
"employee": [
{
"@type": "Person",
"name": "David Pérez"
},
{
"@type": "Person",
"name": "Sacra Jáimez"
}
],
"member": [
{
"@type": "Organization",
"name": "AJE Granada"
},
{
"@type": "Organization",
"name": "WordPress Granada"
}
],
"name": "Closemarketing",
"telephone": "+34858958383"
}
</script>';
echo $sch;
} // home_page schema
}
<?php
echo ‘Esquema de cursos’;
add_action( 'wp_head', 'cmk_add_schema_courses', 20 );
/**
* Shows Schema depeding of post type in header with LD JSON
*
* @return void
*/
function cmk_add_schema_courses() {
if ( is_singular( 'formacion' ) ) {
$post_id = get_the_ID();
$price_raw = get_post_meta( $post_id,
'_listing_price', true );
$time_raw = get_post_meta( $post_id, 'for_dura', true
);
$time = substr_replace( $time_raw, '', -1 );
if ( date( m ) > 6 ) {
$year_start = date( 'Y' );
$year_end = date( 'Y' ) + 1;
} else {
$year_start = date( 'Y' ) - 1;
$year_end = date( 'Y' );
}
$start_date = $year_start . '-09-01';
$end_date = $year_end . '-06-20';
$sch = '<script type="application/ld+json">
{
"@context": "http://schema.org/",
"@id": "./",
"@type": "Course",
"name": "' . get_the_title( $post_id ) . '",
"description": "' . get_the_excerpt( $post_id ) . '",
"hasCourseInstance": [
{
"@type": "CourseInstance",
"name": "' . get_the_title( $post_id ) . '",
"location": {
"@type": "Place",
"address": {
"@type": "PostalAddress",
"addressLocality": "Granada",
"addressRegion": "ESP"
}
},
"description": "' . get_the_excerpt( $post_id ) . '",
"startDate": "' . $start_date . '",
"startDate": "' . $end_date . '",
"timeRequired": "' . $time . '",
"about": "' . get_post_meta( $post_id, 'for_ncursos', true )
. '"
}
]
}
</script>';
echo $sch;
} // Course schema
}
<?php
echo ‘Schema Recetas’;
add_action( 'wp_head', 'cmk_add_schema_pages', 20 );
/**
* Shows Schema depeding of post type in header with LD JSON
*
* @return void
*/
function cmk_add_schema_pages() {
$post_id = get_the_ID();
$cook_time = get_post_meta( $post_id, 'rec_tiempo', true );
$prep_time = get_post_meta( $post_id, 'rec_tiempo', true );
$ingredients = get_post_meta( $post_id, 'rec_ingredient', false );
$recipe_inst = wp_strip_all_tags( get_post_meta( $post_id,
'rec_preparacion', true ) );
$recipe_yield = get_post_meta( $post_id, 'rec_personas', true );
if ( is_singular( 'receta' ) ) {
$sch = '
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "Recipe",
"author": "David Perez",
"cookTime": "PT' . $cook_time . 'M",
"datePublished": "2009-05-08",
"description": " ' . get_the_excerpt() . '",
"image": "' . get_the_post_thumbnail_url() . '",
"recipeIngredient": [';
if ( is_array( $ingredients ) ) {
foreach ( $ingredients[0] as $ingredient ) {
$sch .= '" ' . $ingredient . '",';
}
}
$sch .= '],
"prepTime": "' . $prep_time . '",
"recipeInstructions": "' . $recipe_inst . '",
"recipeYield": "' . $recipe_yield . ' persons",
"suitableForDiet": "http://schema.org/LowFat
}
</script>';
echo $sch;
} // Recipe schema
}
<?php
echo ‘Realizando pruebas’;
/**
* https://search.google.com/structured-data/testing-tool/u/0/
*/
<?php
echo ‘Qué son los Schemas’;
echo ‘<p>Herramienta de Google</p>’;
<?php
echo ‘Qué son los Schemas’;
echo ‘<p>Google Search Console</p>’;
<?php
echo ‘Qué son los Schemas’;
echo ‘<p>Resultado</p>’;
<?php
echo ‘Resumen’;
echo ‘<ul>’;
echo ‘<li>Trabajar con código te da más versatibilidad</li>’;
echo ‘<li>Fácil de implementar</li>’;
echo ‘<li>Muchos Ejemplos</li>’;
echo ‘<li>Podrá aparecer destacado en el buscador</li>’;
echo ‘</ul>’;
<?php
echo ‘<h1>Gracias</h1>’;
/**
* @url https://davidperezgar.com/wcchiclana2020/
**/

More Related Content

Similar to WordCamp Chiclana 2020 Crea schemas sin plugins

Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampAlexei Gorobets
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosIgor Sobreira
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformationArnaud Porterie
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumJeroen van Dijk
 
Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018Izzi Smith
 
FamilySearch Reference Client
FamilySearch Reference ClientFamilySearch Reference Client
FamilySearch Reference ClientDallan Quass
 
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"South Tyrol Free Software Conference
 
Google
GoogleGoogle
Googlesoon
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPiMasters
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3André Wuttig
 
Private slideshow
Private slideshowPrivate slideshow
Private slideshowsblackman
 
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史Shengyou Fan
 
ASP.Net, move data to and from a SQL Server Database
ASP.Net, move data to and from a SQL Server DatabaseASP.Net, move data to and from a SQL Server Database
ASP.Net, move data to and from a SQL Server DatabaseChristopher Singleton
 
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con PythonOpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con PythonPyCon Italia
 
Modware next generation with pub module
Modware next generation with pub moduleModware next generation with pub module
Modware next generation with pub modulecybersiddhu
 
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101colleenfry
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBAlex Zyl
 

Similar to WordCamp Chiclana 2020 Crea schemas sin plugins (20)

Response2
Response2Response2
Response2
 
Real-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @MoldcampReal-time search in Drupal with Elasticsearch @Moldcamp
Real-time search in Drupal with Elasticsearch @Moldcamp
 
Django - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazosDjango - Framework web para perfeccionistas com prazos
Django - Framework web para perfeccionistas com prazos
 
Abusing text/template for data transformation
Abusing text/template for data transformationAbusing text/template for data transformation
Abusing text/template for data transformation
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
 
Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018Winning with Structured Data and Schema.org - OMLIVE 2018
Winning with Structured Data and Schema.org - OMLIVE 2018
 
FamilySearch Reference Client
FamilySearch Reference ClientFamilySearch Reference Client
FamilySearch Reference Client
 
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
SFScon17 - Patrick Puecher: "Exploring data with Elasticsearch and Kibana"
 
Google
GoogleGoogle
Google
 
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHPPHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
PHP Experience 2016 - [Workshop] Elastic Search: Turbinando sua aplicação PHP
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3
 
Private slideshow
Private slideshowPrivate slideshow
Private slideshow
 
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
[PHP 也有 Day] 垃圾留言守城記 - 用 Laravel 阻擋 SPAM 留言的奮鬥史
 
Test upload
Test uploadTest upload
Test upload
 
ASP.Net, move data to and from a SQL Server Database
ASP.Net, move data to and from a SQL Server DatabaseASP.Net, move data to and from a SQL Server Database
ASP.Net, move data to and from a SQL Server Database
 
OpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con PythonOpenERP e l'arte della gestione aziendale con Python
OpenERP e l'arte della gestione aziendale con Python
 
Api vortrag
Api vortragApi vortrag
Api vortrag
 
Modware next generation with pub module
Modware next generation with pub moduleModware next generation with pub module
Modware next generation with pub module
 
Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101Chatting with HIpChat: APIs 101
Chatting with HIpChat: APIs 101
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 

Recently uploaded

DGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdf
DGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdfDGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdf
DGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdfDemandbase
 
DIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdf
DIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdfDIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdf
DIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdfmayanksharma0441
 
Word Count for Writers: Examples of Word Counts for Sample Genres
Word Count for Writers: Examples of Word Counts for Sample GenresWord Count for Writers: Examples of Word Counts for Sample Genres
Word Count for Writers: Examples of Word Counts for Sample GenresLisa M. Masiello
 
McDonald's: A Journey Through Time (PPT)
McDonald's: A Journey Through Time (PPT)McDonald's: A Journey Through Time (PPT)
McDonald's: A Journey Through Time (PPT)DEVARAJV16
 
The Pitfalls of Keyword Stuffing in SEO Copywriting
The Pitfalls of Keyword Stuffing in SEO CopywritingThe Pitfalls of Keyword Stuffing in SEO Copywriting
The Pitfalls of Keyword Stuffing in SEO CopywritingJuan Pineda
 
Fueling A_B experiments with behavioral insights (1).pdf
Fueling A_B experiments with behavioral insights (1).pdfFueling A_B experiments with behavioral insights (1).pdf
Fueling A_B experiments with behavioral insights (1).pdfVWO
 
Call Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCR
Call Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCRCall Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCR
Call Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCRlizamodels9
 
What are the 4 characteristics of CTAs that convert?
What are the 4 characteristics of CTAs that convert?What are the 4 characteristics of CTAs that convert?
What are the 4 characteristics of CTAs that convert?Juan Pineda
 
Best Persuasive selling skills presentation.pptx
Best Persuasive selling skills  presentation.pptxBest Persuasive selling skills  presentation.pptx
Best Persuasive selling skills presentation.pptxMasterPhil1
 
Snapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdf
Snapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdfSnapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdf
Snapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdfEastern Online-iSURVEY
 
How To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot SetupHow To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot Setupssuser4571da
 
Inbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon Garside
Inbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon GarsideInbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon Garside
Inbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon Garsiderobwhite630290
 
Influencer Marketing Power point presentation
Influencer Marketing  Power point presentationInfluencer Marketing  Power point presentation
Influencer Marketing Power point presentationdgtivemarketingagenc
 
ASO Process: What is App Store Optimization
ASO Process: What is App Store OptimizationASO Process: What is App Store Optimization
ASO Process: What is App Store OptimizationAli Raza
 
GreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web RevolutionGreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web RevolutionWilliam Barnes
 
Forecast of Content Marketing through AI
Forecast of Content Marketing through AIForecast of Content Marketing through AI
Forecast of Content Marketing through AIRinky
 
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...Benjamin Szturmaj
 
Social Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdfSocial Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdfSocial Samosa
 
Cost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surgesCost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surgesPushON Ltd
 
Digital Marketing Spotlight: Lifecycle Advertising Strategies.pdf
Digital Marketing Spotlight: Lifecycle Advertising Strategies.pdfDigital Marketing Spotlight: Lifecycle Advertising Strategies.pdf
Digital Marketing Spotlight: Lifecycle Advertising Strategies.pdfDemandbase
 

Recently uploaded (20)

DGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdf
DGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdfDGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdf
DGR_Digital Advertising Strategies for a Cookieless World_Presentation.pdf
 
DIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdf
DIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdfDIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdf
DIGITAL MARKETING STRATEGY_INFOGRAPHIC IMAGE.pdf
 
Word Count for Writers: Examples of Word Counts for Sample Genres
Word Count for Writers: Examples of Word Counts for Sample GenresWord Count for Writers: Examples of Word Counts for Sample Genres
Word Count for Writers: Examples of Word Counts for Sample Genres
 
McDonald's: A Journey Through Time (PPT)
McDonald's: A Journey Through Time (PPT)McDonald's: A Journey Through Time (PPT)
McDonald's: A Journey Through Time (PPT)
 
The Pitfalls of Keyword Stuffing in SEO Copywriting
The Pitfalls of Keyword Stuffing in SEO CopywritingThe Pitfalls of Keyword Stuffing in SEO Copywriting
The Pitfalls of Keyword Stuffing in SEO Copywriting
 
Fueling A_B experiments with behavioral insights (1).pdf
Fueling A_B experiments with behavioral insights (1).pdfFueling A_B experiments with behavioral insights (1).pdf
Fueling A_B experiments with behavioral insights (1).pdf
 
Call Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCR
Call Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCRCall Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCR
Call Girls In Aerocity Delhi ❤️8860477959 Good Looking Escorts In 24/7 Delhi NCR
 
What are the 4 characteristics of CTAs that convert?
What are the 4 characteristics of CTAs that convert?What are the 4 characteristics of CTAs that convert?
What are the 4 characteristics of CTAs that convert?
 
Best Persuasive selling skills presentation.pptx
Best Persuasive selling skills  presentation.pptxBest Persuasive selling skills  presentation.pptx
Best Persuasive selling skills presentation.pptx
 
Snapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdf
Snapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdfSnapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdf
Snapshot of Consumer Behaviors of March 2024-EOLiSurvey (EN).pdf
 
How To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot SetupHow To Utilize Calculated Properties in your HubSpot Setup
How To Utilize Calculated Properties in your HubSpot Setup
 
Inbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon Garside
Inbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon GarsideInbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon Garside
Inbound Marekting 2.0 - The Paradigm Shift in Marketing | Axon Garside
 
Influencer Marketing Power point presentation
Influencer Marketing  Power point presentationInfluencer Marketing  Power point presentation
Influencer Marketing Power point presentation
 
ASO Process: What is App Store Optimization
ASO Process: What is App Store OptimizationASO Process: What is App Store Optimization
ASO Process: What is App Store Optimization
 
GreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web RevolutionGreenSEO April 2024: Join the Green Web Revolution
GreenSEO April 2024: Join the Green Web Revolution
 
Forecast of Content Marketing through AI
Forecast of Content Marketing through AIForecast of Content Marketing through AI
Forecast of Content Marketing through AI
 
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
How videos can elevate your Google rankings and improve your EEAT - Benjamin ...
 
Social Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdfSocial Samosa Guidebook for SAMMIES 2024.pdf
Social Samosa Guidebook for SAMMIES 2024.pdf
 
Cost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surgesCost-effective tactics for navigating CPC surges
Cost-effective tactics for navigating CPC surges
 
Digital Marketing Spotlight: Lifecycle Advertising Strategies.pdf
Digital Marketing Spotlight: Lifecycle Advertising Strategies.pdfDigital Marketing Spotlight: Lifecycle Advertising Strategies.pdf
Digital Marketing Spotlight: Lifecycle Advertising Strategies.pdf
 

WordCamp Chiclana 2020 Crea schemas sin plugins

  • 1. echo ‘<h1>Crea Schemas sin plugins</h1>’; echo ‘<h2>Por David Pérez</h2>’; echo ‘<img src=“https://2020.chiclana.wordcamp.org/files/2019/12/ cropped-logo-WordCamp-Chiclana-2020.png" />’; <?php
  • 2. <?php echo ‘<h1>Quien soy</h1>’; /** * @author David Pérez García * @company Director Closemarketing * @job Desarrollo y Marketing * * https://davidperezgar.com * https://www.closemarketing.es * * @twitter davidperezmk * * @package WordPress * */
  • 3. <?php echo ‘<h1>¿Qué son los Schemas?</h1>’; echo ‘<ul>’; echo ‘<li>Conjunto de etiquetas para describir nuestro contenido</li>’; echo ‘<li>Ofrece semántica enriquecida para los buscadores</li>’; echo ‘<li>Ayuda a entender y clasificar la información</li>’; echo ‘<li>Podrá aparecer destacado en el buscador</li>’; echo ‘</ul>’;
  • 4. <?php echo ‘<h1>Qué son los Schemas</h1>’; echo ‘<ul>’; echo ‘<li>Ejemplo de Schema para películas.</li>’; echo ‘<li>Resultados diferenciados.</li>; echo ‘</ul>’;
  • 5. <?php echo ‘<h1>Qué son los Schemas</h1>’; echo ‘<p>Herramienta para Google Chrome para visualizar Schemas</p>’; Descarga
  • 6. <?php echo ‘<h1>Qué son los Schemas</h1>’;
  • 7. <?php echo ‘¿Qué necesitaremos en WordPress? echo ‘<ul>’; echo ‘<li>Post Types / Entradas personalizadas</li>’; echo ‘<li>Custom Fields / Variables personalizadas</li>’; echo ‘</ul>’;
  • 8. <?php echo ‘Donde consultar’; /** * * https://schema.org * */ /** * Directrices * https://developers.google.com/search/docs/guides/sd-policies * */
  • 9. <?php echo ‘Donde consultar’; /** * https://schema.org/docs/full.html */ 1022 /** * De los que hay… */
  • 10. <?php echo ‘Donde consultar’; /** * * Tipos: * * Action * CreativeWork * Event * Intangible * MedicalEntity * Organization * Person * Place * Product * * * */
  • 11. <?php echo ‘Recoger la información JSON+LD’;
  • 12. <?php echo ‘Donde ubicarlos’; <?php /** * Plugin Name: Nombre del plugin * Plugin URI: https://davidperezgar.com * Description: Desarrollo realizado para entorno WordPress. * Author: David * Author URI: https://twitter.com/davidperezmk * Version: 1.0 * * @package WordPress */ // Schema require_once plugin_dir_path( __FILE__ ) . '/schemas/organization.php'; archivo mu-plugins/functions.php
  • 13. <?php echo ‘Donde ubicarlos’; <?php /** * Utilizar el Plugin Code Snippets * Plugin URI: https://es.wordpress.org/plugins/code-snippets/ */
  • 14. <?php echo ‘Donde colocar el Schema y Cómo subirlo’; add_action( ‘wp_head’, ‘schema_organization’, 20 ); function schema_organization() { if ( is_front_page() ) { echo ' <script type="application/ld+json">
  • 15. <?php echo ‘Schema: Organización’; add_action( 'wp_head', 'cmk_add_schema_home_page', 20 ); /** * Shows Schema depeding of post type home_page in header with LD JSON * * @return void */ function cmk_add_schema_home_page() { if ( is_front_page() || is_home() ) { echo ' <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "address": { "@type": "PostalAddress", "addressLocality": "Granada, España", "postalCode": "18006", "streetAddress": "Calle Jose Luis Pérez Pujadas, 6 Edificio Forum Oficina B29" }, "email": "info@closemarketing.es", "url": "https://www.closemarketing.es/", "description": "Agencia de Marketing Online, Diseñamos Web en WordPress para Granada y Málaga.", "taxID": "ESB19618909", "employee": [ { "@type": "Person", "name": "David Pérez" }, { "@type": "Person", "name": "Sacra Jáimez" } ], "member": [ { "@type": "Organization", "name": "AJE Granada" }, { "@type": "Organization", "name": "WordPress Granada" } ], "name": "Closemarketing", "telephone": "+34858958383" } </script>'; echo $sch; } // home_page schema }
  • 16. <?php echo ‘Schema: Organización’; add_action( 'wp_head', 'cmk_add_schema_home_page', 20 ); /** * Shows Schema depeding of post type home_page in header with LD JSON * * @return void */ function cmk_add_schema_home_page() { if ( is_front_page() || is_home() ) { $sch = ' <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "address": { "@type": "PostalAddress", "addressLocality": "Granada, España", "postalCode": "18006", "streetAddress": "Calle Jose Luis Pérez Pujadas, 6 Edificio Forum Oficina B29" }, "email": "info@closemarketing.es", "url": "https://www.closemarketing.es/", "description": "Agencia de Marketing Online, Diseñamos Web en WordPress para Granada y Málaga.", "taxID": "ESB19618909", "employee": [ { "@type": "Person", "name": "David Pérez" }, { "@type": "Person", "name": "Sacra Jáimez" } ], "member": [ { "@type": "Organization", "name": "AJE Granada" }, { "@type": "Organization", "name": "WordPress Granada" } ], "name": "Closemarketing", "telephone": "+34858958383" } </script>'; echo $sch; } // home_page schema }
  • 17. <?php echo ‘Esquema de cursos’; add_action( 'wp_head', 'cmk_add_schema_courses', 20 ); /** * Shows Schema depeding of post type in header with LD JSON * * @return void */ function cmk_add_schema_courses() { if ( is_singular( 'formacion' ) ) { $post_id = get_the_ID(); $price_raw = get_post_meta( $post_id, '_listing_price', true ); $time_raw = get_post_meta( $post_id, 'for_dura', true ); $time = substr_replace( $time_raw, '', -1 ); if ( date( m ) > 6 ) { $year_start = date( 'Y' ); $year_end = date( 'Y' ) + 1; } else { $year_start = date( 'Y' ) - 1; $year_end = date( 'Y' ); } $start_date = $year_start . '-09-01'; $end_date = $year_end . '-06-20'; $sch = '<script type="application/ld+json"> { "@context": "http://schema.org/", "@id": "./", "@type": "Course", "name": "' . get_the_title( $post_id ) . '", "description": "' . get_the_excerpt( $post_id ) . '", "hasCourseInstance": [ { "@type": "CourseInstance", "name": "' . get_the_title( $post_id ) . '", "location": { "@type": "Place", "address": { "@type": "PostalAddress", "addressLocality": "Granada", "addressRegion": "ESP" } }, "description": "' . get_the_excerpt( $post_id ) . '", "startDate": "' . $start_date . '", "startDate": "' . $end_date . '", "timeRequired": "' . $time . '", "about": "' . get_post_meta( $post_id, 'for_ncursos', true ) . '" } ] } </script>'; echo $sch; } // Course schema }
  • 18. <?php echo ‘Schema Recetas’; add_action( 'wp_head', 'cmk_add_schema_pages', 20 ); /** * Shows Schema depeding of post type in header with LD JSON * * @return void */ function cmk_add_schema_pages() { $post_id = get_the_ID(); $cook_time = get_post_meta( $post_id, 'rec_tiempo', true ); $prep_time = get_post_meta( $post_id, 'rec_tiempo', true ); $ingredients = get_post_meta( $post_id, 'rec_ingredient', false ); $recipe_inst = wp_strip_all_tags( get_post_meta( $post_id, 'rec_preparacion', true ) ); $recipe_yield = get_post_meta( $post_id, 'rec_personas', true ); if ( is_singular( 'receta' ) ) { $sch = ' <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Recipe", "author": "David Perez", "cookTime": "PT' . $cook_time . 'M", "datePublished": "2009-05-08", "description": " ' . get_the_excerpt() . '", "image": "' . get_the_post_thumbnail_url() . '", "recipeIngredient": ['; if ( is_array( $ingredients ) ) { foreach ( $ingredients[0] as $ingredient ) { $sch .= '" ' . $ingredient . '",'; } } $sch .= '], "prepTime": "' . $prep_time . '", "recipeInstructions": "' . $recipe_inst . '", "recipeYield": "' . $recipe_yield . ' persons", "suitableForDiet": "http://schema.org/LowFat } </script>'; echo $sch; } // Recipe schema }
  • 19. <?php echo ‘Realizando pruebas’; /** * https://search.google.com/structured-data/testing-tool/u/0/ */
  • 20. <?php echo ‘Qué son los Schemas’; echo ‘<p>Herramienta de Google</p>’;
  • 21. <?php echo ‘Qué son los Schemas’; echo ‘<p>Google Search Console</p>’;
  • 22. <?php echo ‘Qué son los Schemas’; echo ‘<p>Resultado</p>’;
  • 23. <?php echo ‘Resumen’; echo ‘<ul>’; echo ‘<li>Trabajar con código te da más versatibilidad</li>’; echo ‘<li>Fácil de implementar</li>’; echo ‘<li>Muchos Ejemplos</li>’; echo ‘<li>Podrá aparecer destacado en el buscador</li>’; echo ‘</ul>’;
  • 24. <?php echo ‘<h1>Gracias</h1>’; /** * @url https://davidperezgar.com/wcchiclana2020/ **/