View Single Post
Old 01-27-2015, 02:58 AM   #1
BlurryFont
Registered User
 
Join Date: Aug 2014
Location: India
Posts: 18
How to add WordPress Related Posts Without Plugins

I am currently working on a website programming. Its a WordPress site and i want to add related post option i single post. I have used lot of codes E.G

$main_actor = get_post_meta( $post->ID, 'main actor', true );
$main_actor = sanitize_text_field( $main_actor );

AND

$main_category = get_post_meta( $post->ID, 'main category', true );
$main_category = sanitize_text_field( $main_category );

but its not working. I don't want to add plugin. Anyone here can help me in this topic.

Here Is My Website

Related Post Example :- http://i.imgur.com/n5r0KoW.png
BlurryFont is offline   Reply With Quote