By Polished Geek on Saturday, 24 May 2014
Posted in General Issues
Replies 1
Likes 0
Views 585
Votes 0
Sorry to bug you again - I now need code to get the category title and put it in a page that show a post. This relates to http://stackideas.com/forums/can-i-get-the-category-title.

Example page to get category title for (will appear in green bar over image):
http://iemupgrade.polishedgeekdev.com/newsroom/press-releases/iem-supports-eastern-states-in-improving-interoperability-of-incident-management-systems-during-disasters

In my index.php I have this getting the category name for a blog layout:

if ($view == 'categories' && $id) {
$category = EasyBlogHelper::getTable('Category', 'EasyBlogTable');
$category->load($id);

echo '<h3>'.$category->title.'</h3>';
}


I tried this to put the category name on the post page but it doesn't work:

if ($view == 'entry' && $id) {
$category = EasyBlogHelper::getTable('Category', 'EasyBlogTable');
$category->load($id);
echo '<h3>'.$category->title.'</h3>';
}


Thanks
Hello,

Try this,



Do take note that this might not work with EB 4.0 (Not available yet) though as we are simplifying the whole blog objects.
·
Saturday, 24 May 2014 14:17
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post