ݺߣ

ݺߣShare a Scribd company logo
Front-end en WordPress
Fernando Arias 
Front-end Developer
Front-end en WordPress
Front-end en WordPress
Front-end en WordPress
Front-end en WordPress
/* 
Theme Name: Noticias 
Theme URI: 
Author: Fernando Arias - Disonancias 
Author URI: http://disonancias.com.ar/ 
Description: Tema para mi sitio de noticias 
Version: 1.0 
License: GNU General Public License v2 or later 
License URI: http://www.gnu.org/licenses/gpl-2.0.html 
Tags: responsive-layout, right-sidebar 
Text Domain: noticias 
This theme, like WordPress, is licensed under the GPL. 
*/
Front-end en WordPress
Front-end en WordPress
add_theme_support( 'html5' );
Front-end en WordPress
function dsm_add_styles_scripts(){ 
wp_enqueue_style( 
'dsm-stylesheet', 
get_stylesheet_uri() 
); 
wp_enqueue_script( 
'dsm-noticias', 
get_template_directory_uri() . '/scripts/noticias.js', 
array( 'jquery' ), 
false, 
true 
); 
} 
add_action( 'wp_enqueue_scripts', 'dsm_add_styles_scripts' 
);
function dsm_add_styles_scripts(){ 
wp_enqueue_style( 
'dsm-bootstrap', 
get_template_directory_uri() . '/styles/bootstrap.min.css' 
); 
wp_enqueue_style( 
'dsm-fonts', 
get_stylesheet_directory_uri() . '/styles/fonts.css' 
); 
wp_enqueue_style( 
'dsm-stylesheet', 
get_stylesheet_directory_uri(), 
array( 'dsm-bootstrap', 'dsm-fonts' ) 
); 
wp_enqueue_script( 
'dsm-bootstrap', 
get_template_directory_uri() . '/scripts/bootstrap.min.js', 
array( 'jquery' ), 
false, 
true 
); 
wp_enqueue_script( 
'dsm-noticias', 
get_template_directory_uri() . '/scripts/noticias.js', 
array('dsm-bootstrap'), 
false, 
true 
); 
} 
add_action( 'wp_enqueue_scripts', 'dsm_add_styles_scripts' );
$(document) 
jQuery(document)
Front-end en WordPress
Front-end en WordPress
<!doctype html> 
<html> 
<head> 
<meta charset="utf-8"> 
<title><?php wp_title(); ?></title> 
<?php wp_head(); ?> 
</head> 
<body <?php body_class(); ?>> 
<header> ... </header>
<footer> ... </footer> 
<?php wp_footer(); ?> 
</body> 
</html>
<?php get_header(); ?> 
<main> 
<div class="container"> 
<div class="row"> 
<div class="col-xs-12 col-md-8"> 
<h1>Hola Mundo!</h1> 
<p>Comunidad de WP Argentina</p> 
</div> 
<div class="col-xs-12 col-md-4"> 
<?php get_sidebar(); ?> 
</div> 
</div> 
</div> 
</main> 
<?php get_footer(); ?>
Front-end en WordPress
Front-end en WordPress
add_theme_support( 'post-thumbnails' ); 
set_post_thumbnail_size( 960, 540 ); 
add_image_size( 
'my-thumbnail', 
768, 
432, 
false 
);
Front-end en WordPress
add_theme_support( 
'post-formats', 
array( 
'video', 
'gallery' 
) 
);
Front-end en WordPress
Front-end en WordPress
<?php get_header(); ?> 
<div class="col-xs-12 col-md-8"> 
<?php if( have_posts() ) : the_post(); ?> 
<h1><?php the_title(); ?></h1> 
<?php if( has_post_thumbnail() ) the_post_thumbnail(); ?> 
<p><?php the_content(); ?></p> 
<?php endif; ?> 
</div> 
<div class="col-xs-12 col-md-4"> 
<?php get_sidebar(); ?> 
</div> 
<?php get_footer(); ?>
Front-end en WordPress
Front-end en WordPress
<?php get_header(); ?> 
<div class="col-xs-12 col-md-8"> 
<?php if( have_posts() ) : the_post(); ?> 
<h1><?php the_title(); ?></h1> 
<?php if( has_post_thumbnail() ) the_post_thumbnail(); ?> 
<p><?php the_content(); ?></p> 
<?php endif; ?> 
</div> 
<div class="col-xs-12 col-md-4"> 
<?php get_sidebar(); ?> 
</div> 
<?php get_footer(); ?>
Front-end en WordPress
<?php get_header(); ?> 
<?php if( have_posts() ) : ?> 
<?php while( have_posts() ) : the_post(); ?> 
<div class="col-xs-12"> 
<h1><?php the_title(); ?></h1> 
<?php if( has_post_thumbnail() ) the_post_thumbnail( 'list-img' ); ?> 
<p><?php the_excerpt(); ?></p> 
</div> 
<?php endwhile; ?> 
<?php echo paginate_links(); ?> 
<?php endif; ?> 
<?php get_footer(); ?>
Front-end en WordPress
<?php get_template_part( 'archive' ); ?>
Front-end en WordPress
Front-end en WordPress
Front-end en WordPress
add_theme_support( 'menus' ); 
<header> 
<?php wp_nav_menu( 'header' ); ?> 
</header>
Front-end en WordPress
Front-end en WordPress
Front-end en WordPress
if ( function_exists( 'register_sidebar' ) ) { 
function dsm_theme_register_sidebar() { 
$args = array( 
'id' => 'home-sidebar', 
'name' => 'Home Sidebar', 
'before_widget' => '<div id="%1$s" class="%2$s">', 
'after_widget' => '</div>', 
'before_title' => '<h4>', 
'after_title' => '</h4>' 
); 
register_sidebar($args); 
} 
add_action( 'init', 'dsm_theme_register_sidebar' ); 
}
<aside> 
<?php 
if (function_exists( 'dynamic_sidebar' )): 
dynamic_sidebar( 'home-sidebar' ); 
endif; 
?> 
</aside>
Front-end en WordPress
Front-end en WordPress
Front-end en WordPress

More Related Content

Front-end en WordPress

  • 7. /* Theme Name: Noticias Theme URI: Author: Fernando Arias - Disonancias Author URI: http://disonancias.com.ar/ Description: Tema para mi sitio de noticias Version: 1.0 License: GNU General Public License v2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html Tags: responsive-layout, right-sidebar Text Domain: noticias This theme, like WordPress, is licensed under the GPL. */
  • 12. function dsm_add_styles_scripts(){ wp_enqueue_style( 'dsm-stylesheet', get_stylesheet_uri() ); wp_enqueue_script( 'dsm-noticias', get_template_directory_uri() . '/scripts/noticias.js', array( 'jquery' ), false, true ); } add_action( 'wp_enqueue_scripts', 'dsm_add_styles_scripts' );
  • 13. function dsm_add_styles_scripts(){ wp_enqueue_style( 'dsm-bootstrap', get_template_directory_uri() . '/styles/bootstrap.min.css' ); wp_enqueue_style( 'dsm-fonts', get_stylesheet_directory_uri() . '/styles/fonts.css' ); wp_enqueue_style( 'dsm-stylesheet', get_stylesheet_directory_uri(), array( 'dsm-bootstrap', 'dsm-fonts' ) ); wp_enqueue_script( 'dsm-bootstrap', get_template_directory_uri() . '/scripts/bootstrap.min.js', array( 'jquery' ), false, true ); wp_enqueue_script( 'dsm-noticias', get_template_directory_uri() . '/scripts/noticias.js', array('dsm-bootstrap'), false, true ); } add_action( 'wp_enqueue_scripts', 'dsm_add_styles_scripts' );
  • 17. <!doctype html> <html> <head> <meta charset="utf-8"> <title><?php wp_title(); ?></title> <?php wp_head(); ?> </head> <body <?php body_class(); ?>> <header> ... </header>
  • 18. <footer> ... </footer> <?php wp_footer(); ?> </body> </html>
  • 19. <?php get_header(); ?> <main> <div class="container"> <div class="row"> <div class="col-xs-12 col-md-8"> <h1>Hola Mundo!</h1> <p>Comunidad de WP Argentina</p> </div> <div class="col-xs-12 col-md-4"> <?php get_sidebar(); ?> </div> </div> </div> </main> <?php get_footer(); ?>
  • 22. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 960, 540 ); add_image_size( 'my-thumbnail', 768, 432, false );
  • 24. add_theme_support( 'post-formats', array( 'video', 'gallery' ) );
  • 27. <?php get_header(); ?> <div class="col-xs-12 col-md-8"> <?php if( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php if( has_post_thumbnail() ) the_post_thumbnail(); ?> <p><?php the_content(); ?></p> <?php endif; ?> </div> <div class="col-xs-12 col-md-4"> <?php get_sidebar(); ?> </div> <?php get_footer(); ?>
  • 30. <?php get_header(); ?> <div class="col-xs-12 col-md-8"> <?php if( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php if( has_post_thumbnail() ) the_post_thumbnail(); ?> <p><?php the_content(); ?></p> <?php endif; ?> </div> <div class="col-xs-12 col-md-4"> <?php get_sidebar(); ?> </div> <?php get_footer(); ?>
  • 32. <?php get_header(); ?> <?php if( have_posts() ) : ?> <?php while( have_posts() ) : the_post(); ?> <div class="col-xs-12"> <h1><?php the_title(); ?></h1> <?php if( has_post_thumbnail() ) the_post_thumbnail( 'list-img' ); ?> <p><?php the_excerpt(); ?></p> </div> <?php endwhile; ?> <?php echo paginate_links(); ?> <?php endif; ?> <?php get_footer(); ?>
  • 38. add_theme_support( 'menus' ); <header> <?php wp_nav_menu( 'header' ); ?> </header>
  • 42. if ( function_exists( 'register_sidebar' ) ) { function dsm_theme_register_sidebar() { $args = array( 'id' => 'home-sidebar', 'name' => 'Home Sidebar', 'before_widget' => '<div id="%1$s" class="%2$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>' ); register_sidebar($args); } add_action( 'init', 'dsm_theme_register_sidebar' ); }
  • 43. <aside> <?php if (function_exists( 'dynamic_sidebar' )): dynamic_sidebar( 'home-sidebar' ); endif; ?> </aside>