Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Sidebars & Widgets »

HowTo:a widget listing a category name as the title and entries for the children


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Sep 29, 2009, 07:26 PM
juggledad's Avatar
juggledad
 
22,265 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Let's say you have several categories 'Books', 'Toys', and 'Clothes' and you want to have sub-categories under each, like this:
books->fiction, nonfiction, biography
toys->board games, card games, sports
clothing->mens, womens, children

now what you want in the sidebar is three sections

BOOKS <- NOT a link
fiction <- link
nonfiction <- link
biography <- link

TOYS <- NOT a link
board games <- link
card games <- link
sports <- link

CLOTHING <- NOT a link
mens <- link
womens <- link
children <- link

Here is how you can do this
1) get and activate exec-php plugin (http://bluesome.net/post/2005/08/18/50/)
2) setup your categories and subcategories
3) get the ID of each parent category (dashboard->Posts->Categories->Edit then look at the HTML address in the BROWSER window - the last part is '..&cat_ID=4' - in this case '4' is the ID of this category
4) Add a text widget for each parent category and make the title the name of the parent (i.e 'BOOKS', 'TOYS', "CLOTHING'
5) add the following code to the 'text' part of the widget making sure the number matches the parent category ID
HTML Code:
HTML Code:
<?php echo wp_list_categories('child_of=4'); ?>
That should do it, you will have a list of the parent category and all it's children, but only the children will have links.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Apr 30, 2010 at 05:58 AM. Reason: changed 'wp_list_cat' to 'wp_list_categories' since 'wp_list_cat' has been deprecated
  #2  
Old Apr 30, 2010, 02:30 AM
cfibanez
 
55 posts · Apr 2010
Thanks. I'd like to do this for displaying collections of links in the right sidebar. Say category Jazz (not a link) --> subcategory Podcasts (not a link) --> TheJazzSession (link), Jazzklubb Fasching (link), ECM Records (link).

How can I do this?
  #3  
Old Apr 30, 2010, 05:06 AM
juggledad's Avatar
juggledad
 
22,265 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
What version of Atahualpa and WP?
What is your url?

what part of the instructions did you have problems with?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Apr 30, 2010, 05:18 AM
cfibanez
 
55 posts · Apr 2010
Thanks.

Atahualpa is 3.4.6. Wordpress is 2.9.2.

url is http://carlosibanez.se

I understand the instructions for setting up categories of posts. I would like to do the same with the blogroll of links to external addresses. See e.g. right bar in url above.
  #5  
Old Apr 30, 2010, 06:13 AM
juggledad's Avatar
juggledad
 
22,265 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
well you can try. Use the 'wp_list_bookmarks() function (for reference see http://codex.wordpress.org/Template_...list_bookmarks)

HTML Code:
<?php wp_list_bookmarks('title_li=&category_orderby='name'&category_before=&category_after='); ?>
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #6  
Old May 15, 2011, 06:48 PM
kdellama
 
2 posts · May 2011
Hello - thanks for the great info. I tested this out in my blog and it worked great. The only thing I would like to change (if possible) is the inclusion of the text "Categories" under each section. You can check out the site at http://socalhiker.com . Thanks again.

Ken
  #7  
Old May 15, 2011, 07:25 PM
juggledad's Avatar
juggledad
 
22,265 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
add in '&title_li=' so you have
HTML Code:
<?php echo wp_list_categories('child_of=4&title_li='); ?>
you may have t play with some css to get the list to look the same
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #8  
Old May 16, 2011, 07:56 PM
kdellama
 
2 posts · May 2011
Thanks! Looks much better now.
  #9  
Old Apr 2, 2012, 07:56 AM
Hody's Avatar
Hody
 
156 posts · Apr 2012
Quote:
Originally Posted by juggledad
add in '&title_li=' so you have
HTML Code:
<?php echo wp_list_categories('child_of=4&title_li='); ?>
you may have t play with some css to get the list to look the same
Can this be achieved without the above mentioned plugin. I would like to add one link as last entries to my categories bar (bar2) - I just need to to kinda create the Entry and add the URL of the link somehow?
  #10  
Old Apr 2, 2012, 08:18 AM
juggledad's Avatar
juggledad
 
22,265 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
You have to have the plugin.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Category Page Listing - How to display: Post Title only TotalBalance Excerpts, Read more, Pagination 16 Jan 27, 2010 12:22 PM
Colour of text title in sidebar category posts widget jasonblewis Sidebars & Widgets 2 Jul 29, 2009 07:43 PM
Category title on category page, not on each post excerpt kicker paulae Excerpts, Read more, Pagination 4 Jun 22, 2009 11:33 AM
Widget creation for children pages ? Loo Sidebars & Widgets 1 Mar 20, 2009 08:08 AM
Page Title different Page Menu Bar Listing Shepherd Jim Page & Category Menu Bars 0 Mar 10, 2009 10:25 PM


All times are GMT -6. The time now is 10:02 PM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.