SlideShare una empresa de Scribd logo
1 de 47
Concevoir un thème
  pour wordpress
       De A à Z
Avant de commencer…

• <?php ;?>

• DOM ? HTML ? PHP ?

• ÎÍË|ë“‘{∑∆·flÎÍË
Plan
• Introduction
• Le processus
  – CSS
  – Entête
  – Corps du template
  – Structurer les fichiers
  – Conclusion
A,B,C


• Analyse

• Besoin

• Conception (d‘une maquette)
DàZ

• Développer

• …

• Z : Livrer/Mettre en ligne le template
Objectif du jour
• Concevoir un thème pour wordpress 3.4
  – Liste des articles
  – Sidebar
  – wordpress

• A,B,C - > Slick Gray , par Bryan Smith
  – http://www.quackit.com/html/templates/simple
   _website_templates.cfm
• Pour gagner du temps, nous ferons
 abstraction de l’aspect graphique
  – Transformation d’un layout en html/css/js
     • http://hv-designs.co.uk
Kit graphique      Thème
                  wordpress



Html, css(      Php,css (et
  et js)           js)
Processus
1.Le CSS


   2.L’entête


   3.Sidebar


   4.Le corps
Etape 0

• Créer un dossier contenant les fichiers du
  thème

• Dossier /wp-content/themes/

• index.html > index.php
1. LE CSS
/*
Theme Name: Le nom de votre theme
Theme URI: votre site web
Description: une description
Author: vous
Author URI: http://monkeydo.biz
Version: 1
*/
2. L’ENTÊTE
• <!DOCTYPE html>
• <head>
• <!—meta titre-->
  <title><?php bloginfo('name'); ?><?php
  wp_title(''); ?></title>
• <!—charset-->
  <meta http-equiv="Content-Type"
  content="text/html; charset=<?php
  bloginfo('charset'); ?>" />
•      <meta name="generator"
    content="WordPress <?php bloginfo('version');
    ?>" />
•      <meta name="description" content="<?php
    bloginfo('description'); ?>" />
•      <link rel="stylesheet" type="text/css"
    media="screen" href="<?php
    bloginfo('stylesheet_url'); ?>" />
•      <!--rss-->
    <link rel="alternate" type="application/rss+xml"
    title="<?php bloginfo('name'); ?> RSS Feed"
    href="<?php bloginfo('rss2_url'); ?>" />

•      <!--url pour les pingback--><link
    rel="pingback" href="<?php
    bloginfo('pingback_url'); ?>" />
• </head>
2.CORPS DU TEMPLATE
<body>
     <div id=“container”>
              <div id=“header”></div>
              <div id=“menu”></div>
              <div id=“leftmenu”></div>
              <div id=“contenu”></div>
              <div id=“footer”></div>
     </div>
</body>
Div id=« header »



  <div id="header">

      <h1> <!--nom du blog-->

           <?php bloginfo('name'); ?></h1>

  </div>
<body>
     <div id=“container”>
              <div id=“header”></div>
              <div id=“menu”></div>
              <div id=“leftmenu”></div>
              <div id=“contenu”></div>
              <div id=“footer”></div>
     </div>
</body>
<div id="menu">

   <ul>

    <?php wp_list_categories('title_li=');?>

   </ul>

 </div>
<body>
     <div id=“container”>
              <div id=“header”></div>
              <div id=“menu”></div>
              <div id=“leftmenu”></div>
              <div id=“contenu”></div>
              <div id=“footer”></div>
     </div>
</body>
• Sidebar
  – Widgets

  – Functions.php
Functions.php
<?php
function arphabet_widgets_init() {
    register_sidebar( array(
      'name' => 'Home right sidebar',
      'id' => 'home_right_1',
      'before_widget' => '<div>',
      'after_widget' => '</div>',
      'before_title' => '<h2 class="rounded">',
      'after_title' => '</h2>',
    ) );
}
add_action( 'widgets_init', 'arphabet_widgets_init' );
?>
<div id="leftmenu">
   <div id="leftmenu_top"></div>
                           <div id="leftmenu_main">
      <ul id="sidebar">
      <?php
      if (function_exists('dynamic_sidebar') && dynamic_sidebar('home_right_1')) :
      else :
      ?>
      <?php endif; ?>
      </ul>
     </div>
   <div id="leftmenu_bottom"></div>
 </div>
<body>
     <div id=“container”>
              <div id=“header”></div>
              <div id=“menu”></div>
              <div id=“leftmenu”></div>
              <div id=“contenu”></div>
              <div id=“footer”></div>
     </div>
</body>
<div id="content">
     <div id="content_top"></div>
     <div id="content_main">
       <!-- boucle. -->
           <?php if ( have_posts() ) : while ( have_posts() ) :
he_post(); ?>


   <!—boucle-->


<?php endif; ?>
<div class="post">
            <!-- instruction affichant le titre en tant que permalink,ainsi que la date. -->
            <div id="maintextheader">
              <h2 ><a class="style3" href="<?php the_permalink(); ?>">
               <?php the_title(); ?>
              </a></h2>
              <!-- Display the Time. -->
              <div class="datedujour">
               <small>
                 <?php the_time('j F'); ?>
                </small>
              </div>
            </div>
<!-- afficher le contenu du post -->
            <div class="entry">
             <?php the_content(); ?>
            </div>
            <!-- categories -->
            <p class="postmetadata">Publi&eacute; dans
             <?php the_category(', '); ?>
            </p>
           </div>
<!-- si pas de posts -->
            <?php endwhile; else: ?>
            <p>Désol&eacute; .Pas de posts correspondant </p>
            <!-- fin de la boucle -->
            <?php endif; ?>
      </div>
      <div id="content_bottom"></div>
<body>
     <div id=“container”>
              <div id=“header”></div>
              <div id=“menu”></div>
              <div id=“leftmenu”></div>
              <div id=“contenu”></div>
              <div id=“footer”></div>
     </div>
</body>
<div id="footer"><h3><a
href="http://www.bryantsmith.com">florida web
design</a></h3></div>
  </div>
 </div>
</body>
</html>
4.STRUCTURER LES FICHIERS
• Code de l’entête - > header.php

• Code du corps -> index.php
  – Sidebar ->sidebar.php

• Code du footer -> footer.php
Header
    <?php_get header();?>
Sidebar –
    <?php_get sidebar();?>
Footer
    <?php get_footer()?>
Pour aller un peu plus loin

Créer un carousel



http://www.tutorialstag.com/wordpress-
featured-posts-using-nivo-slider.html

Ps : u
Fin

• Questions ?
  – jeanluc@houedanou.com

  – Twitter @jhouedanou

Más contenido relacionado

La actualidad más candente

jQuery プラグイン作成入門
jQuery プラグイン作成入門jQuery プラグイン作成入門
jQuery プラグイン作成入門Takashi Nojima
 
20110128 HTML5 Markup My Blog
20110128 HTML5 Markup My Blog20110128 HTML5 Markup My Blog
20110128 HTML5 Markup My BlogRimpei Ogawa
 
Week 3 html_css_basics
Week 3 html_css_basicsWeek 3 html_css_basics
Week 3 html_css_basicsEvan Hughes
 
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Wrocław
Tworzenie wtyczek dla TinyMCE 4.* - WordUp WrocławTworzenie wtyczek dla TinyMCE 4.* - WordUp Wrocław
Tworzenie wtyczek dla TinyMCE 4.* - WordUp WrocławTomasz Dziuda
 
Drupal Theming Hans Rossel
Drupal Theming Hans RosselDrupal Theming Hans Rossel
Drupal Theming Hans RosselHans Rossel
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2raj lex
 
CSS設計の理想と現実
CSS設計の理想と現実CSS設計の理想と現実
CSS設計の理想と現実拓樹 谷
 
Blogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelograndeBlogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelograndeangelogrande782
 
Visual keyboard와 tomcat설치 및 이클립스 동기화
Visual keyboard와 tomcat설치 및 이클립스 동기화Visual keyboard와 tomcat설치 및 이클립스 동기화
Visual keyboard와 tomcat설치 및 이클립스 동기화Lay Sukmin Lim
 
Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)
Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)
Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)Román Hernández
 
jQuery Mobileではじめるモバイルサイト/アプリ制作
jQuery Mobileではじめるモバイルサイト/アプリ制作jQuery Mobileではじめるモバイルサイト/アプリ制作
jQuery Mobileではじめるモバイルサイト/アプリ制作yoshikawa_t
 
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp KrakówTworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp KrakówTomasz Dziuda
 

La actualidad más candente (19)

jQuery プラグイン作成入門
jQuery プラグイン作成入門jQuery プラグイン作成入門
jQuery プラグイン作成入門
 
20110128 HTML5 Markup My Blog
20110128 HTML5 Markup My Blog20110128 HTML5 Markup My Blog
20110128 HTML5 Markup My Blog
 
Week 3 html_css_basics
Week 3 html_css_basicsWeek 3 html_css_basics
Week 3 html_css_basics
 
Jquerymobile ppt
Jquerymobile pptJquerymobile ppt
Jquerymobile ppt
 
Latihanjavascript
LatihanjavascriptLatihanjavascript
Latihanjavascript
 
SmartCSS
SmartCSSSmartCSS
SmartCSS
 
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Wrocław
Tworzenie wtyczek dla TinyMCE 4.* - WordUp WrocławTworzenie wtyczek dla TinyMCE 4.* - WordUp Wrocław
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Wrocław
 
jQuery入門
jQuery入門jQuery入門
jQuery入門
 
Drupal Theming Hans Rossel
Drupal Theming Hans RosselDrupal Theming Hans Rossel
Drupal Theming Hans Rossel
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2
 
CSS設計の理想と現実
CSS設計の理想と現実CSS設計の理想と現実
CSS設計の理想と現実
 
Blogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelograndeBlogger template-squeeze-page-angelogrande
Blogger template-squeeze-page-angelogrande
 
Visual keyboard와 tomcat설치 및 이클립스 동기화
Visual keyboard와 tomcat설치 및 이클립스 동기화Visual keyboard와 tomcat설치 및 이클립스 동기화
Visual keyboard와 tomcat설치 및 이클립스 동기화
 
Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)
Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)
Novedades de Front-end 2016 (CSS3, HTML5 y APIs Javascript)
 
jQuery for beginners
jQuery for beginnersjQuery for beginners
jQuery for beginners
 
jQuery Mobileではじめるモバイルサイト/アプリ制作
jQuery Mobileではじめるモバイルサイト/アプリ制作jQuery Mobileではじめるモバイルサイト/アプリ制作
jQuery Mobileではじめるモバイルサイト/アプリ制作
 
Templating WordPress
Templating WordPressTemplating WordPress
Templating WordPress
 
Miniray.php
Miniray.phpMiniray.php
Miniray.php
 
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp KrakówTworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
Tworzenie wtyczek dla TinyMCE 4.* - WordUp Kraków
 

Más de Jean-Luc Houedanou (6)

Wp civ
Wp civ Wp civ
Wp civ
 
Wp civ
Wp civWp civ
Wp civ
 
Faq #WPCIV
Faq #WPCIVFaq #WPCIV
Faq #WPCIV
 
Newsletter 5 & 6
Newsletter 5 & 6Newsletter 5 & 6
Newsletter 5 & 6
 
Presentation cod eci
Presentation cod eciPresentation cod eci
Presentation cod eci
 
Cojeteb
CojetebCojeteb
Cojeteb
 

Concevoir un thème pour Wordpress

  • 1. Concevoir un thème pour wordpress De A à Z
  • 2. Avant de commencer… • <?php ;?> • DOM ? HTML ? PHP ? • ÎÍË|ë“‘{∑∆·flÎÍË
  • 3.
  • 4. Plan • Introduction • Le processus – CSS – Entête – Corps du template – Structurer les fichiers – Conclusion
  • 5. A,B,C • Analyse • Besoin • Conception (d‘une maquette)
  • 6. DàZ • Développer • … • Z : Livrer/Mettre en ligne le template
  • 7. Objectif du jour • Concevoir un thème pour wordpress 3.4 – Liste des articles – Sidebar – wordpress • A,B,C - > Slick Gray , par Bryan Smith – http://www.quackit.com/html/templates/simple _website_templates.cfm
  • 8. • Pour gagner du temps, nous ferons abstraction de l’aspect graphique – Transformation d’un layout en html/css/js • http://hv-designs.co.uk
  • 9.
  • 10. Kit graphique Thème wordpress Html, css( Php,css (et et js) js)
  • 11.
  • 12. Processus 1.Le CSS 2.L’entête 3.Sidebar 4.Le corps
  • 13. Etape 0 • Créer un dossier contenant les fichiers du thème • Dossier /wp-content/themes/ • index.html > index.php
  • 15. /* Theme Name: Le nom de votre theme Theme URI: votre site web Description: une description Author: vous Author URI: http://monkeydo.biz Version: 1 */
  • 17. • <!DOCTYPE html> • <head> • <!—meta titre--> <title><?php bloginfo('name'); ?><?php wp_title(''); ?></title> • <!—charset--> <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" />
  • 18. <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> • <meta name="description" content="<?php bloginfo('description'); ?>" /> • <link rel="stylesheet" type="text/css" media="screen" href="<?php bloginfo('stylesheet_url'); ?>" />
  • 19. <!--rss--> <link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" /> • <!--url pour les pingback--><link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
  • 22. <body> <div id=“container”> <div id=“header”></div> <div id=“menu”></div> <div id=“leftmenu”></div> <div id=“contenu”></div> <div id=“footer”></div> </div> </body>
  • 23. Div id=« header » <div id="header"> <h1> <!--nom du blog--> <?php bloginfo('name'); ?></h1> </div>
  • 24.
  • 25. <body> <div id=“container”> <div id=“header”></div> <div id=“menu”></div> <div id=“leftmenu”></div> <div id=“contenu”></div> <div id=“footer”></div> </div> </body>
  • 26. <div id="menu"> <ul> <?php wp_list_categories('title_li=');?> </ul> </div>
  • 27.
  • 28. <body> <div id=“container”> <div id=“header”></div> <div id=“menu”></div> <div id=“leftmenu”></div> <div id=“contenu”></div> <div id=“footer”></div> </div> </body>
  • 29. • Sidebar – Widgets – Functions.php
  • 30. Functions.php <?php function arphabet_widgets_init() { register_sidebar( array( 'name' => 'Home right sidebar', 'id' => 'home_right_1', 'before_widget' => '<div>', 'after_widget' => '</div>', 'before_title' => '<h2 class="rounded">', 'after_title' => '</h2>', ) ); } add_action( 'widgets_init', 'arphabet_widgets_init' ); ?>
  • 31. <div id="leftmenu"> <div id="leftmenu_top"></div> <div id="leftmenu_main"> <ul id="sidebar"> <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('home_right_1')) : else : ?> <?php endif; ?> </ul> </div> <div id="leftmenu_bottom"></div> </div>
  • 32.
  • 33. <body> <div id=“container”> <div id=“header”></div> <div id=“menu”></div> <div id=“leftmenu”></div> <div id=“contenu”></div> <div id=“footer”></div> </div> </body>
  • 34. <div id="content"> <div id="content_top"></div> <div id="content_main"> <!-- boucle. --> <?php if ( have_posts() ) : while ( have_posts() ) : he_post(); ?> <!—boucle--> <?php endif; ?>
  • 35. <div class="post"> <!-- instruction affichant le titre en tant que permalink,ainsi que la date. --> <div id="maintextheader"> <h2 ><a class="style3" href="<?php the_permalink(); ?>"> <?php the_title(); ?> </a></h2> <!-- Display the Time. --> <div class="datedujour"> <small> <?php the_time('j F'); ?> </small> </div> </div>
  • 36. <!-- afficher le contenu du post --> <div class="entry"> <?php the_content(); ?> </div> <!-- categories --> <p class="postmetadata">Publi&eacute; dans <?php the_category(', '); ?> </p> </div>
  • 37. <!-- si pas de posts --> <?php endwhile; else: ?> <p>Désol&eacute; .Pas de posts correspondant </p> <!-- fin de la boucle --> <?php endif; ?> </div> <div id="content_bottom"></div>
  • 38.
  • 39.
  • 40. <body> <div id=“container”> <div id=“header”></div> <div id=“menu”></div> <div id=“leftmenu”></div> <div id=“contenu”></div> <div id=“footer”></div> </div> </body>
  • 42.
  • 44. • Code de l’entête - > header.php • Code du corps -> index.php – Sidebar ->sidebar.php • Code du footer -> footer.php
  • 45. Header <?php_get header();?> Sidebar – <?php_get sidebar();?> Footer <?php get_footer()?>
  • 46. Pour aller un peu plus loin Créer un carousel http://www.tutorialstag.com/wordpress- featured-posts-using-nivo-slider.html Ps : u
  • 47. Fin • Questions ? – jeanluc@houedanou.com – Twitter @jhouedanou