This website can use cookies to improve the user experience

This website can use cookies to improve the user experience and to provide certain services and functions to users. Cookies contain small amounts of information (such as login information and user preferences) and will be stored on your device.

Enable All Cookies Privacy Policy

Categories


avatar
LRACMS 0
From: -
Categories

I'd like to display the category name in the header after print and user comments - over on the right side of the bar. Tried, but unsuccessfully.

- Louis Andrews

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.

Responses to this topic


1 Re: Categories
avatar
OP 0
From: -
Categories

Bravo! All works now.

- Louis
1 Re: Categories
avatar
Administrator
1340
From: Vienna, Austria
Categories

Do you mean the archive headline list or the story display?

For the story display:

Open the template "story" and add after:
// Teaser image?
if ($insert[story_teaser]) $teaserline = "<img src=\"images/teaser/$insert[story_teaser]\" border=\"0\" align=\"right\" hspace=\"10\" vspace=\"10\">";


the following code:
//Get story category
$query = DBQuery("SELECT category_name FROM esselbach_st_categories WHERE category_id = '$insert[story_category]'");
list ($insert[story_category]) = mysql_fetch_row($query);


Then find:
Posted by $insert[story_author] on: $insert[story_time]<br />


and replace it with:
Posted by $insert[story_author] on: $insert[story_time] [ Category: $insert[story_category] ]<br />
1 Re: Categories
avatar
OP 0
From: -
Categories

Thanks Philipp,

That seems to work fine for the home and category lists, but not for the Archive. Do I need to change the code somewhere else to make it work there as well.

- Louis Andrews
1 Re: Categories
avatar
OP 0
From: -
Categories

Thanks Phillipp
1 Re: Categories
avatar
Administrator
1340
From: Vienna, Austria
Categories

Find in the template "news" this line:

<a href="https://www.contentteller.com/story.php?id=$insert[story_id]">$insert[story_comments] Comment(s)</a> ]<br />


and replace it with:
<a href="https://www.contentteller.com/story.php?id=$insert[story_id]">$insert[story_comments] Comment(s)</a> | Category: $insert[story_category] ]<br />

Notice

This topic is archived. New comments cannot be posted and votes cannot be cast.