Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 07-01-2007, 10:23 PM   #1
everestcash
Confirmed User
 
Join Date: Apr 2002
Posts: 2,194
Wordpress category description. Please, help.

I wanna display descriptions next to each category name on index page, but I'm not familiar with PHP at all

I edited the code like this:

<?php wp_list_cats('sort_column=name'); ?> - <?php echo category_description($cat); ?>
but it doesn't work properly

Could you please advice?

p.s. I thought I need something like show_description parameter that exists for <?php get_links(); ?>
but seems like it doesn't exists for <?php wp_list_cats('); ?>
everestcash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 10:27 PM   #2
everestcash
Confirmed User
 
Join Date: Apr 2002
Posts: 2,194
or maybe you can just give me a link to any theme that uses category descriptions
so I could look for it in the code
everestcash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-01-2007, 11:48 PM   #3
everestcash
Confirmed User
 
Join Date: Apr 2002
Posts: 2,194
bump for me
everestcash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 12:08 AM   #4
peterp
Confirmed User
 
Join Date: Mar 2006
Posts: 137
please try it with these : <?php category_description(category); ?>
__________________
peterp is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 01:13 AM   #5
everestcash
Confirmed User
 
Join Date: Apr 2002
Posts: 2,194
thanks, but i've already tried that ((
everestcash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 01:16 AM   #6
Bods4Mods
Confirmed User
 
Join Date: Nov 2005
Posts: 904
bump for getting it solved
__________________
Bods4Mods is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 03:18 AM   #7
woman
Confirmed User
 
woman's Avatar
 
Join Date: Feb 2005
Location: Austria
Posts: 100
Try this:
PHP Code:
<?php
$exclude 
'';

// $orderby - Category table column (record) to sort on; for column
// options see note #2 above.
$orderby 'cat_name';

// $order - The sort order method. Use 'ASC'ending or 'DESC'ending.
$order 'ASC';

/* << user-configurable variables << */

if($exclude) { // set up the category exclude list for the query
    
$and '';
    
$wherecat 'AND (';
    
$exclude_cat preg_split('/[\s,]+/'$exclude);
    foreach (
$exclude_cat as $xcat) {
        
$wherecat .= $and ' cat_ID <> ' $xcat ' ';
        
$and 'AND';
    }
    
$wherecat .= ')';
}

global 
$wpdb// making sure the WP database object is around
/* the next line assigns the query results to $categories */
$categories $wpdb->get_results("SELECT * FROM $wpdb->categories WHERE category_count > 0 $wherecat ORDER BY $orderby $sort"); // $wp_object_cache->cache['category'];
?>
<?php 
/* >> category list loop >> the important part! */ ?>
<?php 
while(list(,$category) = each($categories)) : // start loop ?>
        <p>
        <h3 id="cat-<?php echo $category->cat_ID?>"><a href="<?php echo get_category_link($category->cat_ID); // returns category url ?>" title="<?php echo $category->cat_name?>"><?php echo $category->cat_name?></a></h3>
        <?php echo $category->category_description?> (<?php echo $category->category_count?> posts)
        </p>
<?php endwhile; // end loop ?>
<?php 
/* << category list loop << */ ?>
Greetings, woman
__________________
Sexgirls! makes money with VideoBox
woman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 05:27 AM   #8
everestcash
Confirmed User
 
Join Date: Apr 2002
Posts: 2,194
Thanks A Lot!
everestcash is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 07-02-2007, 05:47 AM   #9
woman
Confirmed User
 
woman's Avatar
 
Join Date: Feb 2005
Location: Austria
Posts: 100
Always at your service! (For questions about wordpress )
__________________
Sexgirls! makes money with VideoBox
woman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.