Last active
April 7, 2018 01:11
-
-
Save hawkidoki/970b17361ff33069a485e5afa5a1887b to your computer and use it in GitHub Desktop.
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 get_header(); ?> | |
<div class="row"> | |
<!-- Contenu Principal --> | |
<div class="col-lg-8"> | |
<!-- Template: loop.php --> | |
<!-- Query: WP_Query globale (page en cours) --> | |
<!-- Not_found: Traitement dans le fichier de template --> | |
<!-- Utilisation de tous les arguments par défaut... --> | |
<!-- Pas besoin de while(have_posts()): the_post() (effectué dans le Template) --> | |
<?php hwk_loop(); ?> | |
<!-- Posts Relatif --> | |
<!-- Template: templates/related.php --> | |
<!-- Query: New WP_Query / 3 derniers posts du post_type 'post' --> | |
<!-- Exclude: Exclusion automatique des posts des requêtes hwk_loop() antérieures --> | |
<!-- Not_found: Traitement dans le fichier templates/not-found.php --> | |
<!-- Wrappert: Affichage du Template dans le html: --> | |
<!-- <section class="related" data-post-id="8">{{Template}}</section> --> | |
<?php | |
hwk_loop(array( | |
'template' => 'templates/related.php', | |
'not_found' => 'templates/not-found.php', | |
'query' => array( | |
'post_type' => 'post', | |
'posts_per_page' => 3 | |
), | |
'wrapper' => array( | |
'element' => 'section', | |
'attr' => array( | |
'class' => 'related', | |
'data-post-id' => get_the_ID() // Post ID de la page principale en cours. | |
) | |
) | |
)); | |
?> | |
</div> | |
<!-- Sidebar --> | |
<div class="col-lg-4"> | |
<!-- Template: templates/sidebar.php --> | |
<!-- Query: New WP_Query / 3 derniers posts du post_type 'post' --> | |
<!-- Exclude: Exclusion automatique des posts des requêtes hwk_loop() antérieures --> | |
<!-- Not_found: Traitement dans le fichier de template --> | |
<?php | |
hwk_loop(array( | |
'template' => 'templates/sidebar.php', | |
'query' => array( | |
'post_type' => 'post', | |
'posts_per_page' => 3 | |
) | |
)); | |
?> | |
</div> | |
</div> | |
<?php get_footer(); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment