Page 1 of 1

Category Descriptions and List

Posted: Wed Feb 27, 2019 3:17 am
by Mark
<mediumish theme>
I noticed it is possible to enter a description in a category. How is this displayed on the website? When I navigate to a category webpage I assumed I would able to see the description right under the category title. This would also be very helpful in all the corresponding meta data.

I would also like to be able to display the categories in the footer or sidebar of the theme.

Maybe just point me to the documentation for the theme?

Thanks in advance.

Re: Category Descriptions and List

Posted: Wed Feb 27, 2019 2:32 pm
by bayerberg
if you want to display that info in your page.php try something like

Code: Select all

  $categoryKey = $page->categoryKey();
  $category = getCategory($categoryKey);
  echo '<h2>' . $category->name(). '</h2>';
  echo '<h4>' . $category->description(). '</h4>';

Re: Category Descriptions and List

Posted: Thu Feb 28, 2019 2:12 am
by Mark
Thank you for your help! I am going to mess around with this. It appears I will have to make another template or make a if/then argument. I don't know how to do that but I will play with it and see if I can make that happen.

Something like this

Code: Select all

<!-- Begin Tags -->
			<?php if (!empty($page->tags(true))): ?>
			<div class="after-post-tags">
				<ul class="tags">
					<?php foreach ($page->tags(true) as $tagKey=>$tagName): ?>
					<li><a href="<?php echo DOMAIN_TAGS.$tagKey ?>"><?php echo $tagName; ?></a></li>
					<?php endforeach ?>
				</ul>
			</div>
			<?php endif; ?>