How to create a new div for a custom tag in Blogger?

85 Views Asked by At

I have a site on Blogger. I share book quotes on this site. At the same time, as of today, I started to share poems. The section below shows all my posts:

my website posts layout

I want to create a separate area for poems and show the publications with the tag "Poetry" here. What should I do?

1

There are 1 best solutions below

0
Lucas Macedo On

I imagine you are using WordPress to create your blog, in this case you need to create a loop by calling some variables that you want to display, such as number of posts, titles, thumbnail, etc.

Below I will leave a snippet of my website code and a print of how it is displayed on the front-end

<div>
                  <?php query_posts( array( 'post_type'=> 'noticias', 'posts_per_page' => 1, 'orderby' => 'title', 'order' => 'ASC' ) ); ?>
                    <?php
                        if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
                <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" style="text-decoration: none; color: #303030;">
                        <?php the_post_thumbnail('medium', array('class' => 'indicacao')); ?>
                            <div>
                                <h5><?php the_title(); ?></h5>
                            </div>
                    </a>
                  <?php endwhile; endif; ?>
                <?php wp_reset_query(); ?>
              </div>

ScreenShot

I suggest you take a look at the WordPress documentation and the forum, where you can get more information about it.

If not WordPress, please provide more information about your code.