Share
Embed
Estructura de un Theme de WordPress
Presentación utilizada en el Meetup de WordPress Madrid
fzberlinches
May 07, 2012
Transcript
10 slides
-
Estructura de un Theme de WordPress #madridwordpress
@madridwordpress -
Componentes básicos de un Theme • styles.css: el principal
que u?liza WordPress para obtener información del tema antes de hacer la ac?vación por parte del usuario. Con?ene el nombre, autor, url, caracterís?cas, etc. • index.php: página inicial que con?ene la estructura de nuestro si?o. Por defecto muestra un listado de entradas ordenadas por las más recientes con un enlace inferior para ver entradas anteriores. En el panel puedes decidir qué página de inicio quieres mostrar. -
Componentes básicos de un Theme • /* Theme
Name: Twenty Eleven Theme URI: hOp://wordpress.org/extend/themes/twentyeleven Author: the WordPress team Author URI: hOp://wordpress.org/ Descrip?on: The 2011 theme for WordPress is sophis?cated, lightweight, and adaptable. Make it yours with a custom menu, header image, and background -‐-‐ then go further with available theme op?ons for light or dark color scheme, custom link colors, and three layout choices. Twenty Eleven comes equipped with a Showcase page template that transforms your front page into a showcase to show off your best content, widget support galore (sidebar, three footer areas, and a Showcase page widget area), and a custom "Ephemera" widget to display your Aside, Link, Quote, or Status posts. Included are styles for print and for the admin editor, support for featured images (as custom header images on posts and pages and as large images on featured "s?cky" posts), and special styles for six different post formats. Version: 1.3 License: GNU General Public License License URI: license.txt Tags: dark, light, white, black, gray, one-‐column, two-‐columns, leb-‐sidebar, right-‐sidebar, fixed-‐width, flexible-‐width, custom-‐background, custom-‐colors, custom-‐header, custom-‐menu, editor-‐style, featured-‐image-‐header, featured-‐ images, full-‐width-‐template, microformats, post-‐formats, rtl-‐language-‐support, s?cky-‐post, theme-‐op?ons, transla?on-‐ ready */ /* =Reset default browser CSS. Based on work by Eric Meyer: hOp://meyerweb.com/eric/tools/css/reset/index.html -‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐-‐ */ -
Componentes básicos de un Theme • /* <?php
get_header(); if ( have_posts() ) : while ( have_posts() ) : the_post(); the_content(); endwhile; endif; get_sidebar(); get_footer(); ?> -
Componentes básicos de un Theme • get_header(): buscará header.php
– get_header(“home”): buscará header-‐home.php • get_sidebar(): buscará sidebar.php – get_sidebar(“home”): buscará sidebar-‐home.php • get_footer(): buscará footer.php – get_footer(“home”): buscará footer-‐home.php -
Componentes básicos de un Theme • single.php: detalle de
una entrada – single-‐posOype.php • page.php: detalle de una página por defecto. Puedes crear tus propias plan?llas para páginas y especificar en el editor cuál usar. – page-‐id.php – page-‐slug.php • home.php: en caso de exis?r se usará para la página inicial de tu si?o • archive.php – category.php • category-‐id.php • category-‐slug.php – tag.php • tag-‐id.php • tag-‐slug.php • 404.php • func?ons.php -
Child Themes /* Theme Name:
Twenty Eleven Child Theme URI: hOp://example.com/ Descrip?on: Child theme for the Twenty Eleven theme Author: Your name here Author URI: hOp://example.com/about/ Template: twentyeleven Version: 0.1.0 */ @import url("../twentyeleven/style.css"); #site-‐?tle a { color: red; } -
Themes básicos de WordPress • Classic: 8 ficheros
• Default (Kubrick): 18 ficheros y una carpeta • Twentyten: 27 ficheros y dos carpetas • Twentyeleven: 37 ficheros y cinco carpetas