![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
![]() Hello. Im trying to style the wp_list_categories tag (<?php
wp_list_categories('arg'); ?>). i know that i can style it using an unordered list and css. Something like this: <ul class="cat_list"><?php wp_list_categories('show_count=1&hide_empty=1&titl e_li=<h2>Categories</ h2>'); ?></ul> That will print a list of categories, hide categories with zero post, and show title called "categories". What i would like to do though is make the parent category links look different from the child category links (have a different font size or use <h3> tag for parent category), so i how would i do that? Like i said I know how to style whole list but how can I make this customization happen? Or is it not possible? Thanks for any help. ![]()
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
bumperoo
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Dec 2001
Location: AZ
Posts: 7,697
|
bump for ya
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
well, I don't have an example with categories and subcategories at hand (oh my, why in hell every single person asking for help NEVER includes the example so they can actually be helped?) but if you constructed it using defaults you should have something like
Code:
<ul> <li>Cat 1</li> <li>Cat2 <ul> <li> Cat 2 Children category </li> </ul> </li> </ul> Code:
<li> Cat 2 Children category </li> ![]()
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
Quote:
sorry i was tired when i made thread...the wp_list_categories prints your category list heres a snippet of code from the default wordpress theme sidebar: Code:
<?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?> http://www.hotmovies.com/categories.php The parent cats are bold and using the <h3> tag, therefore helping to show the difference between parent and child cats. Is that possible in wordpress?
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
bump for me
![]()
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Industry Role:
Join Date: Jan 2004
Posts: 182
|
Code:
$sql = "SELECT name,slug,$wpdb->terms.term_id as ID,parent FROM $wpdb->terms ". "LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) ". "WHERE parent=5 AND taxonomy='category' ORDER BY name ASC"; $categoryList = $wpdb->get_results($sql); echo categoryPrint($categoryList); function categoryPrint($results, $multiple = "", $subcat_level = 0){ global $wpdb; if(!$results){return;} foreach($results as $a_cat){ if($multiple){ categoryPrintSelectItem($a_cat, $subcat_level); } else{ categoryPrintItem($a_cat, $subcat_level); } $sql = "SELECT name,slug,$wpdb->terms.term_id as ID,parent FROM $wpdb->terms ". "LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) ". "WHERE parent=$a_cat->ID AND taxonomy='category' ORDER BY name ASC"; $sub_cats = $wpdb->get_results($sql); categoryPrint($sub_cats, $multiple, $subcat_level + 1); } } function categoryPrintSelectItem($a_cat, $subcat_level){ for($i = 0; $i < $subcat_level; $i++){ echo "…"; } echo $a_cat->name."</option>\n"; } function categoryPrintItem($a_cat, $subcat_level){ for($i = 0; $i < $subcat_level; $i++){ echo "{$a_cat->name}<br>"; } if($subcat_level < 1){ echo "<b><h3>{$a_cat->name}</h3></b><br>"; } } Code:
WHERE parent=5 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,372
|
Quote:
have a look at the default wordpress css styling, theirs one for child cats. http://digwp.com/2010/05/default-wor...-styles-hooks/
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Confirmed User
Industry Role:
Join Date: Jan 2004
Posts: 182
|
Quote:
Figured this would get the job done without telling him what CSS styles he needed to change ;) |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
Quote:
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
Confirmed User
Industry Role:
Join Date: Jul 2008
Location: In your back seat with duck tape
Posts: 4,568
|
this may require custom solution it seems...
__________________
High Performance Vps $10 Linode Manage your Digital Ocean, Linode, or Favorite Cloud Server. Simple, fast, and secure Server Pilot |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 | |
Confirmed User
Industry Role:
Join Date: Jul 2001
Location: 127.0.0.1
Posts: 9,266
|
Quote:
Code:
<?php $sub_cat = wp_list_categories('echo=0&orderby=name&title_li=&hierarchical=0&child_of='.$category->cat_ID); ?> <ul class="subcat"><?php echo $sub_categories; ?></ul> <?php } ?>
__________________
This post is endorsed by CIA, KGB, MI6, the Mafia, Illuminati, Kim Jong Il, Worldwide Ninjas Association, Klingon Empire and lolcats. Don't mess around with it, just accept it and embrace the truth |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
I make pixels work
Industry Role:
Join Date: Jun 2005
Location: I live here...
Posts: 24,386
|
Watch out... I ICQ'd Fris once and all the sudden my dog died.
ICQ at your own risk...
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |