Adding Related Posts Programmatically

Posted in: Newsmag
Post count: 1

I’m currently trying to implement the related posts feature from the Newsmag theme into a third party plugin.

That plugin runs a raw version of the posts, with the content and general WordPress files, but it doesn’t include js and css files from other plugins.

The related posts are being displayed, but the posts that are being displayed are the latest ones. In other words, they are not related to the current post in any way.

Here is the code that I have been using:


$current_post = get_post();
$td_mod_single = new td_module_single($current_post);
echo $td_mod_single->related_posts(true);

Is there anything missing there? Perhaps a global or a parameter that should be included?

I’d appreciate your assistance on this.

Thanks!

Post count: 20688

Hi,

In the theme the related articles section should be sorted by latest, but filtered according to the setting chosen. Either by category or by tag, maybe these screens would be of help to you
https://www.screencast.com/t/nRvK2rGIcH
https://www.screencast.com/t/0Zje5wC1

Thanks

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newsmag’ is closed to new topics and replies.