eliz15
Forum Replies Created
-
Forum: Themes and Templates
In reply to: [Hueman] Latest post appears twiceThank you for the proposition ! It doesn’t work and it “bypasses” the exclude function too… For the moment I found this solution : multiple loops, a loop for each category and showposts=1 and offset=1.
<div class="post-list group"> <div class="post-row"> <?php $qualite_eau = new WP_Query('category_name=qualite-de-leau&showposts=>1&offset=1'); ?> <?php while ($qualite_eau->have_posts()) : $qualite_eau->the_post(); ?> <?php get_template_part('content'); ?> <?php endwhile; ?> <?php rewind_posts(); ?> <?php $act_littorales = new WP_Query('category_name=act-littorales&showposts=1&offset=1');?> <?php while ($act_littorales->have_posts()) : $act_littorales->the_post(); ?> <?php get_template_part('content'); ?> <?php endwhile; ?> <?php rewind_posts(); ?> <?php $cours_eau = new WP_Query('category_name=cours-eau&showposts=1&offset=1'); ?> <?php while ($cours_eau->have_posts()) : $cours_eau->the_post(); ?> <?php get_template_part('content'); ?> <?php endwhile; ?> </div> <?php rewind_posts(); ?> </div><!--/.post-list-->The problem is the offset option applies to the category posts not the latest post in all categories, which is logical but so I get the second to last post of each category.
Ok, sorry ! I will close this one and keep the other open.
Forum: Themes and Templates
In reply to: [Hueman] Making the header full sizeSome questions to see if I can help you :
– I think you want your header to be full width ?
– Are you working on a child theme ?
– Can you work directly on the wordpress directory and files, for example can you go to your site directory and then in wp-content/themes/ ?Forum: Themes and Templates
In reply to: [Hueman] Latest post appears twiceSo, now :
– I succeed to display only three posts below the featured post,
– The featured post isn’t duplicated in those little posts,
– Thanks to your code bdbrown, only the posts of specific categories are returnedWork in progress ! But, the problem is it displays the latest posts of all those categories taken together. So if I publish 2 posts with category ID “5” now, it displays 2 posts of this category and the most recent post after that.
However, it’s not exactly what I want. I want to display the latest post of each category, like this : latest post of category ID=3, latest post of category ID=4, latest post of category ID=5. Is it possible without multiple loops ? If yes, how to customize the main loop ?Forum: Themes and Templates
In reply to: [Hueman] Latest post appears twiceThank you it works !! I think you’re right, I had created a page template home.php where there were 3 loops to call each category, so it certainly was bypassing the exclude function.
But now I just have another little problem, it displays all the posts of each category, not just one. I suppose there is a “showpost=1” or “posts_per_page=-1” (not sure of the syntax) to add somewhere, but where ?
Maybe somewhere in the default loop of index.php ?<div class="post-list group"> <?php $i = 1; echo '<div class="post-row">'; while ( have_posts() ): the_post(); ?> <?php get_template_part('content'); ?> <?php if($i % 3 == 0) { echo '</div><div class="post-row">'; } $i++; endwhile; echo '</div>'; ?> </div><!--/.post-list--> <?php endif; ?>Forum: Themes and Templates
In reply to: [Hueman] Latest post appears twiceHi, first, thank you to answer me !
Here is a temporary link : http://ns341408.ip-37-187-167.eu/smre/And no my featured post isn’t set as a sticky post. I’d like the featured post to show the latest post I’ve published, and the three little posts to show the latest post of each category (except the featured post)…
Thank you for your help ! I tried the method with the “post__not_in” parameter and the $do_not_duplicate transformed in array but it didn’t work… So I’ve posted on the Hueman support page like you say. Should I close this topic ?