SlideShare une entreprise Scribd logo
1  sur  46
Fernando Arias 
Front-end Developer
/* 
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. 
*/
add_theme_support( 'html5' );
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)
<!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(); ?>
add_theme_support( 'post-thumbnails' ); 
set_post_thumbnail_size( 960, 540 ); 
add_image_size( 
'my-thumbnail', 
768, 
432, 
false 
);
add_theme_support( 
'post-formats', 
array( 
'video', 
'gallery' 
) 
);
<?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(); ?>
<?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(); ?>
<?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(); ?>
<?php get_template_part( 'archive' ); ?>
add_theme_support( 'menus' ); 
<header> 
<?php wp_nav_menu( 'header' ); ?> 
</header>
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

Contenu connexe

En vedette

Итоги работы Администрации Слободо-Туринского муниципального района и сельски...
Итоги работы Администрации Слободо-Туринского муниципального района и сельски...Итоги работы Администрации Слободо-Туринского муниципального района и сельски...
Итоги работы Администрации Слободо-Туринского муниципального района и сельски...slturmr
 
P1 e1 internet
P1 e1 internetP1 e1 internet
P1 e1 internetRaul Lopez
 
Trabajar mejor es posible
Trabajar mejor es posibleTrabajar mejor es posible
Trabajar mejor es posibleMobile Jazz
 
Cuantificacion de pop (3)
Cuantificacion de pop (3)Cuantificacion de pop (3)
Cuantificacion de pop (3)maryori
 
Enterprise Gamification
Enterprise GamificationEnterprise Gamification
Enterprise GamificationMarta Rauch
 
Mc donald's case study - Gamification in customer engagement - Manu Melwin Joy
 Mc donald's case study - Gamification in customer engagement  - Manu Melwin Joy Mc donald's case study - Gamification in customer engagement  - Manu Melwin Joy
Mc donald's case study - Gamification in customer engagement - Manu Melwin Joymanumelwin
 
Cocacola case study - Gamification in customer engagement - Manu Melwin JOy
Cocacola case study - Gamification in customer engagement  - Manu Melwin JOyCocacola case study - Gamification in customer engagement  - Manu Melwin JOy
Cocacola case study - Gamification in customer engagement - Manu Melwin JOymanumelwin
 

En vedette (12)

Nccu2013
Nccu2013Nccu2013
Nccu2013
 
Resume
ResumeResume
Resume
 
Repositorios
RepositoriosRepositorios
Repositorios
 
Итоги работы Администрации Слободо-Туринского муниципального района и сельски...
Итоги работы Администрации Слободо-Туринского муниципального района и сельски...Итоги работы Администрации Слободо-Туринского муниципального района и сельски...
Итоги работы Администрации Слободо-Туринского муниципального района и сельски...
 
P1 e1 internet
P1 e1 internetP1 e1 internet
P1 e1 internet
 
Trabajar mejor es posible
Trabajar mejor es posibleTrabajar mejor es posible
Trabajar mejor es posible
 
Cuantificacion de pop (3)
Cuantificacion de pop (3)Cuantificacion de pop (3)
Cuantificacion de pop (3)
 
Enterprise Gamification
Enterprise GamificationEnterprise Gamification
Enterprise Gamification
 
Mc donald's case study - Gamification in customer engagement - Manu Melwin Joy
 Mc donald's case study - Gamification in customer engagement  - Manu Melwin Joy Mc donald's case study - Gamification in customer engagement  - Manu Melwin Joy
Mc donald's case study - Gamification in customer engagement - Manu Melwin Joy
 
Happiness visions WoHaSu government track 2017
Happiness visions WoHaSu government track 2017Happiness visions WoHaSu government track 2017
Happiness visions WoHaSu government track 2017
 
Cocacola case study - Gamification in customer engagement - Manu Melwin JOy
Cocacola case study - Gamification in customer engagement  - Manu Melwin JOyCocacola case study - Gamification in customer engagement  - Manu Melwin JOy
Cocacola case study - Gamification in customer engagement - Manu Melwin JOy
 
Clase 1 Huesos Del Craneo
Clase 1 Huesos Del CraneoClase 1 Huesos Del Craneo
Clase 1 Huesos Del Craneo
 

Front-end en WordPress

  • 1.
  • 3.
  • 4.
  • 5.
  • 6.
  • 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. */
  • 8.
  • 9.
  • 11.
  • 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' );
  • 15.
  • 16.
  • 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(); ?>
  • 20.
  • 21.
  • 22. add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 960, 540 ); add_image_size( 'my-thumbnail', 768, 432, false );
  • 23.
  • 24. add_theme_support( 'post-formats', array( 'video', 'gallery' ) );
  • 25.
  • 26.
  • 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(); ?>
  • 28.
  • 29.
  • 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(); ?>
  • 31.
  • 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(); ?>
  • 33.
  • 35.
  • 36.
  • 37.
  • 38. add_theme_support( 'menus' ); <header> <?php wp_nav_menu( 'header' ); ?> </header>
  • 39.
  • 40.
  • 41.
  • 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>