iam working on my first wp theme and iam new to php and wordpress. i need to create a single category widget that displays at least five posts from specific category. inside this post loop i need a conditional function to make the first post different from the rest. to be clear iam using a plugin that gives me all the needed option except conditional function that makes the first post different from the others. is there any one could help me By editing the plugin file to add this conditional function . or showing me the entire code from scratch.thanks
There isn't much code to this plugin, main output is done by pretty straightforward loop.
Unfortunately plugin gives no way to control styling of individual items so you will have to either:
fork it and edit to output class for styling for first item alone
try to make use of CSS for styling of existing markup (
:first-childif I am not mistaken)