Close Menu
My SiteMy Site
  • Home
  • Reviews
  • Computers
  • How Tos
  • Travel & Lifestyle
  • Phone ROMs
  • Contact
    • Advertise
    • About Us
Facebook X (Twitter) Instagram
My SiteMy Site
  • Home
  • Reviews
  • Computers
  • How Tos
  • Travel & Lifestyle
  • Phone ROMs
  • Contact
    • Advertise
    • About Us
My SiteMy Site
Home»Web Design Tips»Wordpress»How To Display Related Post In Carrington Mobile Theme Without Plugin
Wordpress

How To Display Related Post In Carrington Mobile Theme Without Plugin

Oscar FrankBy Oscar Frank2 Mins Read
Share
Facebook Twitter LinkedIn WhatsApp Pinterest Email

I recently put up a guide on how you can install and use the carrington mobile theme for your wordpress blog, and I got a Facebook private message from someone requesting how he can easily customize and add up a related post widget to the mobile friendly design.

adding related post to carrington mobile theme

Just like any other wordpress theme, the file in charge of displaying posts in the Carrington theme is the single.php file and that’s where we would be adding the WP query that would output the related post widget.

Note: The related post we would be adding here is based on wordpress tags, meaning it relates articles you added tags to. If you don’t make use of the tags while posting in wordpress, this would not work for you.

Adding Related Post To Carrington Mobile

This would require you logging into your cPanel > File manager so as to edit the core single.php file of your carrington theme.

1. Login to cPanel > Filemanger then follow the path public_html/your site name/wp-content/themes/carrington-mobile-1.2 .

2. In this directory, you’ll see all the theme files, right click on the single.php file and click on Edit.

3. Once the page loads to edit, Search using CTRL + F for “cfct_content();” without the quotes and in the line after the code paste the below code.

 ?>
<?php
//for use in the loop, list 5 post titles related to first tag on current post
$tags = wp_get_post_tags($post->ID);
if ($tags) {
echo 'Related Posts';
$first_tag = $tags[0]->term_id;
$args=array(
'tag__in' => array($first_tag),
'post__not_in' => array($post->ID),
'showposts'=>5,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
}
?>
<?php

4. Then Click on Save at the top right corner of the screen.

As I said earlier in this post, it would only work on sites where the tags are made use of.

Resource: How To Add Related Post To WordPress Without Plugins

Carrington Design Wordpress Responsive Design Responsive Webdesign wordpress tips

Related Posts

WordPress Blog Hosting made easy with SeekaHost Blog Hosting Control Panel

December 4, 2020

How to Create a Website with Elementor Page Builder in WordPress

April 1, 2019

Top 3 Reasons Backing Up Your Files Offsite Is Extremely Important

February 27, 2018
View 20 Comments

20 Comments

  1. SLIMZEEY on June 27, 2014 9:12 pm

    Thank You Bro, Is cool and it is working for me

    Reply
    • Oscar Frank on July 3, 2014 9:06 pm

      Hi SLimzeey,
      Thanks a ton for letting us know it did work on your WordPress blog. Your comment is really appreciated, BTW, thanks for coming by.

      Reply
  2. Donvin on September 4, 2014 3:57 am

    I will go try it on my blog and i will let you know if it works fine on my blog. Thanks bro Oscar.

    Reply
    • Oscar Frank on September 6, 2014 5:30 am

      You are very much welcome pal, Thanks for dropping by.

      Reply
  3. Stanley on September 13, 2014 11:30 am

    Oscar your site is very informative

    Reply
    • Oscar Frank on September 15, 2014 2:25 am

      Thanks for the compliment. I do appreciate your comment down here.

      Reply
  4. okhype on October 9, 2014 6:05 pm

    its working, tanx

    Reply
    • Oscar Frank on October 10, 2014 3:58 am

      You are very much welcome Okhype.

      Reply
  5. olamide on October 17, 2014 4:40 am

    Its not working for me… Any time I fix d code.. I get error

    Reply
    • Oscar Frank on October 19, 2014 1:39 pm

      Hi Olamide,
      What error do you get?

      Reply
      • segunyomi on December 13, 2014 7:10 pm

        Plzz

        Reply
  6. segun yomi on November 7, 2014 2:00 pm

    Its not working here please help me out

    Reply
  7. segun yomi on December 7, 2014 10:34 am

    Good morning oscar please I need your help , am using carrington mobile for the mobile version of my website, I want to know how to increase the amount of post displayed in home and other categories from 15 to 25 , just to increase the number of post displayed

    Reply
  8. segun yomi on December 10, 2014 9:16 am

    Hi oscar , am using carrington mobile for the mobile version of my website ,please how can I increase the amount of post that is displayed on the home page and other categories, it only displaces 15 post and I want it to be 30 please help

    Reply
  9. Mayowa on December 17, 2014 9:39 am

    My host doesn’t use an easy CP as such.. Can u pls tell me how to insert it through the theme editor??

    Reply
  10. dan on November 12, 2015 9:04 pm

    It give me syntax error saying ‘unexpected T string bla bla’

    Please help

    Reply
  11. haywhy on January 2, 2016 5:06 pm

    how do i remove the featured image from this theme

    Reply
  12. Isy on April 6, 2016 8:32 pm

    Please I don’t know the actual place to paste the code am I going to replace this or placing it before or after or in bracket? put me through please

    Reply
  13. Wizkid Ayo on June 19, 2017 6:28 pm

    i love this post

    Reply
  14. Mrvalva on June 28, 2019 3:34 pm

    Nice one oscarmini

    Reply
Leave A Reply Cancel Reply

Recent Posts
  • 6 Sports Apps You Must Have On Your Phone
  • Valencia Travel Guide: All You Need to Know About This Spanish Gem
  • TikTok Faces Unexpected Ban in Senegal, Sparks Global Curiosity
  • The Apple GPT & Apple’s Chatbot Mysterious Debut
  • Triller Takes on TikTok: Filing for Public Listing
Get Exclusive Tech Insights!
My Site
Facebook X (Twitter) Instagram YouTube
© 2025 Oscarmini Co. Designed by illBytes.

Type above and press Enter to search. Press Esc to cancel.