Skip to content
  • About us
  • Contact
  • en_USEN
  • viVI
FacebookTwitterPinterest
HOWTOHOWTO
  • All
    • Tips
      • Google
      • Facebook
      • Tiktok
    • Instruct
      • What is Q&A?
      • Taobao
    • WordPress
      • Code
      • Plugins
      • Themes
        • Flatsome
        • Theme Nevo
  • ShareHot
    • WordPress
    • Code
    • Plugins
    • Tips
    • Windows
    • Apple
    • Graphics
    • Experience
  • Graphics documents
    • illustrator
    • Sketchup
    • Coreldraw
    • 3ds max
    • Enscape
    • Photoshop
    • Graphics Plugin
  • Course
    • Photoshop course
    • illustrator course
    • Coreldraw course
    • Edit video course
    • Course Sketchup
    • Autocad course
    • Website management course
  • Service
  • Software
    • Windows
      • Tips
      • Office
      • Necessary
      • Tools
    • Apple
  • Game
  • News
    • Technology
    • Review
Hello!

  • Lost your password ?
HOWTOHOWTO
  • Home > 
  • Wordpress > 
  • Flatsome > 
  • Share beautiful related article code for Flatsome

Share beautiful related article code for Flatsome

By How To 02/12/2025 0 508 Views
Share beautiful related article code for Flatsome
Article categories

Share beautiful related article code for Flatsome.When you write an article, there will often be related topics associated with that category. Then your article will forever stay on your website and no one will know about it.

To make your SEO content better. The code below will help you display all related articles in the same category to help your articles reach better. Thereby also helping users experience your website for the longest time. That's the SEO trick. Now I will Share beautiful related article code for Flatsome Comes with detailed instructions for you to follow.

Note: This code can only be used for the Flatsome theme and cannot be used for other themes to avoid copying it to another theme and then not being able to use it.

see more

  • The code condenses product details and categories on Flatsome
  • The code shows nice promotions for flatsome like Cellphones
  • Code to display hotline on website
  • Code to automatically save images to hot when copying images from other pages

How to insert beautiful related article code for Flatsome

Step 1: Login hoting

Share beautiful related article code for Flatsome
Share related article code for Flatsome

You need to log in to the hotline where you rented the server > File > Find your website > Create 1 files in hosting with name Single.php

Step 2: Copy the Code Single.php

After creating, you need to copy the entire code below inside the file Single.php

<?php
get_header();
?>
<div id="content" class="blog-wrapper blog-single page-wrapper">
<?php get_template_part( 'template-parts/posts/layout', get_theme_mod('blog_post_layout','right-sidebar') ); ?>
<div class="row row-large">
<div class="large-9 col">
<div class="danh-muc"><span class="titles">Category: </span><?php
$category_list = get_the_category_list( __( ' ', 'flatsome' ) );
printf($category_list, the_title_attribute( 'echo=0' ) );?></div>
<div class="the-tim-kiem"><span class="titles">Key word:</span><?php echo get_the_tag_list('&nbsp;',' ',''); ?></div>
</div>
</div>
<div id="secrelatedcat" class="sec-relatedcat">
<div class="row row-large">
<div class="large-12 col">
<?php
$categories = get_the_category(get_the_ID());
if ($categories){
echo '<div class="relatedcat">';
$category_ids = array();
foreach($categories as $individual_category) $category_ids[] = $individual_category->term_id;
$args=array(
'category__in' => $category_ids,
'post__not_in' => array(get_the_ID()),
'posts_per_page' => 8, // So bai viet dc hien thi
);
$my_query = new wp_query($args);
if( $my_query->have_posts() ):
echo '<h3 class="relatedcat__title"><span>Bài viết liên quan</span></h3><ul>';
while ($my_query->have_posts()):$my_query->the_post();
?>
<li>
<div class="relatedcat-thumnail">
<a href="<?php%20the_permalink()%20?>">
<?php the_post_thumbnail(); ?>
</a>
</div>
<a href="<?php%20the_permalink()%20?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php
endwhile;
echo '</ul>';
endif; wp_reset_query();
echo '</div>';}?>
</div>
</div>
</div>
</div>
<?php get_footer();

Step 3: CSS makes it more beautiful

To make your related posts display better, you need to css it so your display will look better.

You need to copy it into your CSS section by following the following link. Display > Theme file editor > Style.css

Share beautiful related article code for Flatsome
Nice related article code for Flatsome
/* Related article css Author: hocdohoacaptoc.com */ .blog-wrapper.blog-single .container.section-title-container .section-title.section-title-center { justify-content: center;} .blog -wrapper.blog-single .container.section-title-container .section-title.section-title-center b { display: none;} .single-post .entry-header-text { margin-top: 0 !important; } .by-wpdiscuz { display: none;} .post-views.post-12886.entry-meta { padding-bottom: 0;} .entry-meta__entry-review { display: flex; align-items: center;} span.post-views-icon.dashicons.dashicons-chart-bar { display: none !important;} span.a_posted-on.posted-views { display: flex;} span.a_byline { color : #999; margin-bottom: 0; line-height: 23px; font-size: 14px; margin-right: 0; letter-spacing: 0;} .archive .hide-archive { display: none !important;} .relatedcat ul > li > a { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; height: 40px;} .relatedcat { border: none !important;} .sec-relatedcat { background-color: #f5f5f5;} .blog-wrapper.blog-single.page-wrapper { padding-bottom: 0;} .relatedcat{ border:2px dashed red; padding:5px; margin-top:10px; margin-bottom:10px; overflow:hidden} .recent-blog-posts a{ font-size:14px} .relatedcat h3{ color:red; font-style:italic} .relatedcat li a{ color:#242424} .relatedcat li{ padding-left:10px; margin-left:0} .relatedcat li a:hover{ color:Blue} .relatedcat li i,.relatedcat h3 i{ padding-right:5px} #theh1 { display: none;} @media (min-width: 849px) { .relatedcat ul { overflow: hidden; margin: 0 -10px;} .relatedcat ul > li { list-style: none; width: 25%; padding: 8px 10px; float: left; margin-bottom: 20px;} .relatedcat ul > li img { object-fit: cover; width: 100%; height: 175px; border-radius: 5px; transition: transform .5s;} .relatedcat ul > li > a { line-height: 20px; display: block; margin-top: 10px;}} /* Running out of related article CSS */

Step 4: Check the results again.

After you add correctly, we will have a section displaying related articles like the image below.

Share beautiful related article code for Flatsome
Nice related article code for Flatsome

Conclude

So I just shared it Nice related article code for Flatsome beautiful for you. Hopefully this code will help make your article more lively. Through this, your articles will also become richer.

Don't forget to follow us on facebook to be updated with the latest information

Tags : Tags related article code   code flatsome   Code   Flatsome
Share
FacebookShare on FacebookpinterestShare on PinterestMessengerShare on Facebook Messenger
twitterShare on TwitterlinkedinShare on LinkedinvkShare on VkredditShare on ReddittumblrShare on TumblrvideoShare on Viadeobuffer. bufferShare on Bufferpocket. pocketShare on PocketwhatsappShare on WhatsappViberShare on ViberemailShare on EmailskypeShare on SkypediggShare on DiggmyspaceShare on MyspacebloggerShare on Blogger YahooMailShare on Yahoo mailtelegramShare on Telegram gmailShare on GmailAmazonShare on AmazonSMSShare on SMS
How To

How To

A person who is passionate about sharing knowledge from life. Common knowledge in life. Sharing is my passion. Hopefully my knowledge will bring many benefits to you

Leave a Comment Cancel reply

Categories What is Q&A? What is the structure of that place?

What is Interior Design? How much does an interior design job pay?

12/12/2025
What is Material?

What is Material? Material application in the field of design

11/12/2025
What is the poster?

What are posters? 9 Tips for designing beautiful, quick Posters

11/12/2025
What does graphic design do? Is it easy to get a job?

What does graphic design do? Is it easy to get a job?

11/12/2025
Water is the water material in Enscap

Water is the water material in Enscap

11/12/2025

Recent comments

  • male1 year ago
    On How to create a fade effect in Photoshop
    Great
  • phat phat2 years ago
    On Who is 5SMedia?
    Useful article
  • Minh Anh3 years ago
    On How to create basic materials in vray Sketchup
    Very good, admin
Copyright © 2025 HOWTO - Powered by HOWTO

5SMedia.net | hocdohoacaptoc.com | huongdansudung.vn | webantam.com

Back to Top
Hello!
  • All
    • Tips
      • Google
      • Facebook
      • Tiktok
    • Instruct
      • What is Q&A?
      • Taobao
    • WordPress
      • Code
      • Plugins
      • Themes
        • Flatsome
        • Theme Nevo
  • Share
    • WordPress
    • Code
    • Plugins
    • Tips
    • Windows
    • Apple
    • Graphics
    • Experience
  • Graphics documents
    • illustrator
    • Sketchup
    • Coreldraw
    • 3ds max
    • Enscape
    • Photoshop
    • Graphics Plugin
  • Course
    • Photoshop course
    • illustrator course
    • Coreldraw course
    • Edit video course
    • Course Sketchup
    • Autocad course
    • Website management course
  • Service
  • Software
    • Windows
      • Tips
      • Office
      • Necessary
      • Tools
    • Apple
  • Game
  • News
    • Technology
    • Review
en_US EN
en_US EN vi VI