Skip to content

Instantly share code, notes, and snippets.

@ximosa
Last active August 29, 2015 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ximosa/5e70750325e55833fc37 to your computer and use it in GitHub Desktop.
Save ximosa/5e70750325e55833fc37 to your computer and use it in GitHub Desktop.
Códigos básicos para crear temas en WordPress.
/* 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
*/
<?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;?>
<?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
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