Last active
August 29, 2015 14:28
-
-
Save ximosa/5e70750325e55833fc37 to your computer and use it in GitHub Desktop.
Códigos básicos para crear temas en WordPress.
This file contains 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
/* Theme Name: Mini | |
Theme URI: http://lapaginademitema.com | |
Description: Explicación sobre mi tema | |
Version: 1 | |
Author: Tu nombre | |
Author URI: http://mipaginaweb.com | |
Tags: doscolumnas, azul, arial | |
*/ |
This file contains 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 if(have_posts()):?> | |
<?php while(have_posts()): the_post();?> | |
<!-- campos de contenido y marcas de html--> | |
<?php the_title()?> | |
<?php endwhile;?> | |
<?php else: ?> | |
No hay contenido en esta página | |
<?php endif;?> |
This file contains 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 the_title() ?> El título | |
<?php the_date()?> Fecha de publicación | |
<?php the_excerpt() ?> El resumen del texto de una entrada | |
<?php the_content() ?> El texto entero de una entrada o página | |
<?php the_post_thumbnail() ?> Imagen destacada, opcionalmente parámetros "thumbnail","medium","large" | |
<?php the_permalink() ?> El enlace de la página única del contenido | |
<?php the_author() ?> El autor del post | |
<?php the_category() ?> Las categorias, linakbles del post | |
<?php the_tags() ?> Las etiquetas linkables del post | |
<?php bloginfo('name'); ?> Título del blog | |
<?php bloginfo('description'); ?> Subtítulo del tema | |
<?php bloginfo(‘template_url’); ?> Ruta al tema actual | |
<?php previous_post_link(); ?> Link al post anterior | |
<?php next_post_link(); ?> Link al siguiente post | |
Menú | |
<?php wp_nav_menu(); ?> Inserta el menú principal |
This file contains 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
Registrar un widget de area | |
register_sidebar( array( | |
'name' => ‘test’, | |
'id' => ‘test’, | |
) ); | |
insetarlo en un lugar | |
<?php | |
dynamic_sidebar(‘test’); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment