Conclusion the articles in Wordpress on the main different types?

Hello! Please tell me the best way to implement this conclusion articles wordpress?5a71945f1f553240153681.jpeg
June 8th 19 at 17:30
1 answer
June 8th 19 at 17:32
Solution
Thank you - karine commented on June 8th 19 at 17:35
But if you want to add a class for the specified blocks (I want to implement bootstrap) whether there are ready decisions ? - karine commented on June 8th 19 at 17:38
, XS, personally, I bootstrap bypass tenth expensive, as the site of the explosion of the atomic bomb - Velva.Rogahn commented on June 8th 19 at 17:41
Does not tell me why ?:) - karine commented on June 8th 19 at 17:44
Seriously? 200+ KB of CSS, 300+ KB of JS not including jQuery (which it would not leave, so plyusuem have it) full naplevatelstvo on the semantics and adequate DOM, a terrible mess of the classes in the HTML and so on. One word - bad code. Well the brakes.

All the same is done beautifully and elegantly on Vanille. But if you do it at least a year, then you already (should be) your libs / snippets, thus forming your own framework, without all this garbage. - Velva.Rogahn commented on June 8th 19 at 17:47
to collect the custom WP_Query to pull the function with a parameter class, depending on poryadkova rooms. If layout is critical will differ, it is best instead of a class to use a template item, jerking get_template_part - Zoe92 commented on June 8th 19 at 17:50
well if you have to go into the backend, why custom WP_Query? In the standard cycle, which is on the main query, all is the same. Additional custom queries are necessary for obtaining other posts, not to change the standard query. - Velva.Rogahn commented on June 8th 19 at 17:53
In the vast found, like You mean ?
<?php 
 $count = 0; //set up counter variable
 while (have_posts()) : the_post(); 
 $count++; //increment the variable by 1 each time the loop executes
 if ($count<4) {
 // here put the special code for first three
}
 // here put the code for normal posts
endwhile;
 ?>
- karine commented on June 8th 19 at 17:56
Yes, the meaning of this. Once you have conditions will be more, and in addition to the comparisons > < >= <= will have to use the % operator. In General, if you want to take care of adding classes - so that. If you are not afraid of CSS - try using nth-child - Velva.Rogahn commented on June 8th 19 at 17:59
usually when they make these pages pull not only posts, but also a variety of axonometry. - Zoe92 commented on June 8th 19 at 18:02
can is if to use a switch. - Zoe92 commented on June 8th 19 at 18:05
,
usually when they make these pages pull not only posts, but also a variety of axonometry.


Have no idea what is "taxonometric", but if you're talking about taxonomy, they in the main loop (as in any arbitrary WP_Query is the default) and so are drawn using update_post_caches(). Monitored data using subqueries parameter WP_Query 'update_post_term_cache' => bool (and 'update_post_meta_cache' => bool metadata, respectively). The default is true, so the terms of taxonomies and metadata work. Learn some materiel.

instead if to use a switch.


Not always. Switch is a reasonable alternative if/elseif/else when the conditions are linked to the logic. In this case, this approach (if/elseif or switch instead) may lead to code duplication. Using a series of if (no elseif/else) can be more efficient (it is possible there will have to be row-wrapping to do, for example). Again, materiel. Return and other early literacy. - Velva.Rogahn commented on June 8th 19 at 18:08
, taxonomy of course)
Only now realized how nekorrektno wrote about wp_query, of course, under castanotto I meant parameters)

Using a series of if (no elseif/else) can be more efficient (it is possible there need to be row-wrapping to do, for example). Again, materiel. Return erly and other literacy.

this is interesting, thanks) - Zoe92 commented on June 8th 19 at 18:11
,
of course, under castanotto I meant parameters)

In this case, it is still pre_get_posts :) - Velva.Rogahn commented on June 8th 19 at 18:14

Find more questions by tags WordPress