I am looking to create a behavior as shown in the following link:
http://www.javaexperience.com/java-role-of-serialversionuid-in-serialization/
Here all posts from the same category are being displayed. Currently, it is handwritten HTML code, I want to mimic this behavior using PHP code in my single.php.
Following is the code I have written so far
<?php
$category = get_the_category();
<ul>
query_posts('cat='.$category);
if ( have_posts() ) : while ( have_posts() ) : the_post();
<li><a href="get_permalink( $id );">the_title();</a></li>
endwhile; endif;
</ul>
<br/>
?>
Can someone help in making it work?
Try this:
Then use this hook in your query:
You can do this using Wp_query() by passing the category name as an argument: