73 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Nominata says

Hey Guys,

Hopefully this will be a simple piece of code I will just add to my theme template but what I want to do is on each category page of my wordpress is to dynamically add the Description part at the top of the page.

So on my category page it goes then I want under it.

Does anyone know how to pull the Category Description into my theme?

Thanks Chris

963 posts
  • Has been part of the Envato Community for over 6 years
  • Has sold $10,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
EireStudio says
<?php single_cat_title(); ?>
242 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
ATLChris says
<?PHP echo category_description(); ?>

You can use that if you are inside the loop in the category page. That will echo out the description assigned to the category via the category section of the Wordpress admin panel.

73 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Nominata says

Thanks guys will implement it now :)

Any way to get this to show also in a META Description?

73 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Nominata says

Im trying this

<meta name='DESCRIPTION' content='<?php category_description(''); ?>'>

But its bringing back black in the content bit?

242 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
+2 more
ATLChris says
Im trying this <meta name='DESCRIPTION' content='&lt;?php category_description(''); ?&gt;'> But its bringing back black in the content bit?

category_description() has to be inside the loop as I said earlier. I you want to have it inside the loop, you need to find a way to pass the category ID to the function:

<?PHP echo category_description(3); ?>

See Documentation: http://codex.wordpress.org/Template_Tags/category_description

73 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Nominata says

Hey no I got it to work in the Category page fine :) thanks for that. The Category Description now shows on the page for example (http://www.pspcentre.co.uk/pspwallpapers/cars/)

Now I was thinking I should pull the description into the META Description for the Category, but I then wanted to pull the first say 100 Characters of the Post to give the Posts META Description.

2468 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has referred 100+ members
  • Has been a beta tester for an Envato feature
+3 more
digitalimpact says
Now I was thinking I should pull the description into the META Description for the Category, but I then wanted to pull the first say 100 Characters of the Post to give the Posts META Description.

Why don’t you use the All In One SEO Pack plug-in ?

73 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
Nominata says

Hey Yes Im using that now :) thanks.

Cheers

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by