I will put you through on how to display related post in carrington mobile theme without using any plugin, most of us are addicted to using plugins for everything forgetting most of the cheap plugins we use daily can actually be written in just 5 lines of codes. 🙂

If you finding it difficult to install or how to use carrington mobile framework i have written a article about that, i have been seeing a lot of people looking for a way to add related post in carrington mobile theme easily in different forums.

Carrington mobile is built in a every easy way that don’t require deep knowledge to make use of this framework.

The small grid of related articles below a blog post has become widely used. It is so commonplace and effective that many online advertising platforms have modeled the display for their ad units.

Related post functionality is one place where I recommend you DON’T use a plugin. It is straightforward to hard-code a nice related post system.

Here is most of the commonly used carrington mobile themes online.

How To Add Related Post In Carrington Mobile Theme Without Plugin

You can perform this operation offline using your laptop or online from your cpanel.

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

  • Login to cPanel
  • Click Filemanger then follow the path public_html/your site/wp-content/themes/carrington-mobile-1.2 .or if you using it as only mobile theme then access it from /wp-content/plugins/carrington
  • In this directory, you’ll see all the theme files, right click on the single.php file and click on Edit.
  • 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.

This is a safe method to add related post to your carrington mobile theme.

Join our Active Telegram Group chat for discussions and updates
Join Now
This Post was Last updated on February 27th, 2019, we update our content constantly to give you the best.
Note: We don't support duplicate content, this material and other digital content on this website may not be reproduced, published, broadcast, rewritten or redistributed in whole or in part without prior express written permission from Deegeek Nigeria. All content are protected by the Digital Millemium Copyright Act 1996 (DCMA)