Portal Home > Knowledgebase > Articles Database > Wordpress - Category Question


Wordpress - Category Question




Posted by Biju, 03-03-2008, 11:20 AM
Friends, I was just doing some coding in PHP, i am struck in a part. Can anyone state me whats the problem.... I want to show one post from the certain category if visited. This certain code works but displays the recent post. If i place cat = 43 or something it works perfectly. My Question is Why is echo $category[0]->cat_ID; not printing out the ID number dynamically based on the category. Note : I am not a PHP programmer. I am a JAVA. Regards

Posted by foobic, 03-03-2008, 06:17 PM
Because you're trying to run the echo command inside a quoted string. But you don't want it printed out anyway, you want to pass it as a parameter. Try this:



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
question (Views: 704)
cpanel remote backup (Views: 727)
phpbb vs typo3 (Views: 696)