73 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United Kingdom
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

962 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Ireland
  • Sold between 10 000 and 50 000 dollars
EireStudio says
<?php single_cat_title(); ?>
242 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • United States
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United Kingdom
Nominata says

Thanks guys will implement it now :)

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

73 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United Kingdom
Nominata says

Im trying this

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

But its bringing back black in the content bit?

242 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 1 and 9 users
  • Sold between 10 000 and 50 000 dollars
  • United States
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United Kingdom
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.

2429 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
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
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • United Kingdom
Nominata says

Hey Yes Im using that now :) thanks.

Cheers

by
by
by
by
by
by