¿Estás buscando una manera de insertar automáticamente un divisor de post “div” que puedas estilizar usando la clase “post-item-divider”? Si bien es probable que haya un plugin para esto, hemos creado un fragmento de código rápido que se puede utilizar para añadir post divisor entre dos mensajes o más en WordPress.
Instrucciones:
Todo lo que tienes que hacer es añadir este código al archivo single.php de tu tema antes del bucle:
<?php if (($wp_query->current_post + 1) < ($wp_query->post_count)) { echo '<div class="post-item-divider">Post Divider</div>'; } ?>
Nota: Si es la primera vez que añades fragmentos de código en WordPress, consulta nuestra guía sobre cómo añadir correctamente fragmentos de código en WordPress, para no romper accidentalmente tu sitio.
Si te ha gustado este fragmento de código, por favor, considere la posibilidad de revisar nuestros otros artículos en el sitio como: 62 mejores temas gratuitos para blogs en WordPress y cómo crear un formulario de donación en WordPress.
I like these all watch style.Thanks for sharing this post.
no problem glad that I could help
For a blog to be
successful it needs to be well written, frequently updated, well designed and
honest.Well i liked your tips.Thanks for sharing.
Great Blog. I add
this Blog to my bookmarks.
Your way of presentation is really too good. I
am totally impressed by your post. I am looking for your more updates. Keep
them coming
Great and excellent explained article.Really very descriptive.Many Thanks for sharing such article.
Among the different popular accessories laptop stand has gained high popularity.Really its amazing.I like this content.I like this post.Thanks to share this blog.
Well its good to
read your article.Its a great shared information.I liked the conversation of
you guys as well.Thanks for sharing.Keep sharing as like this always.
This is my first time reading this blog. Definitely won’t be my last though, really enjoyed it.Thank you for the article. Exactly what I was looking for!
Luckily I found this, very confusion in this before I found this, now it’s clear….