Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How does one call up a specific category in WordPress?
Old 09-29-2009, 07:07 AM How does one call up a specific category in WordPress?
Average Talker

Posts: 25
Trades: 0
Here's the code I'm using for my menu bar:

<ul>
<li <?php if(is_home()){echo 'class="current_page_item"';}?>><a href="<?php bloginfo('siteurl'); ?>" class="stuff" title="Home">Home</a></li>
<li><a href="<?php echo get_settings('home'); ?>" class="stuff">Articles</a>
<ul><?php wp_list_categories('sort_column=name&title_li=&dep th=2'); ?></ul>
</li>
<?php wp_list_pages('title_li=&depth=2');?>
</ul>

As you can see, it has one item for the home page, one item that calls up all categories present on the site, and one that calls up all pages on the site. Let's say I wanted to create another <li> that included a link to a specific category. I'd probably type in <?php and then something. What would that be?
Fudge is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-29-2009, 07:11 PM Re: How does one call up a specific category in WordPress?
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
You can create a link by hard-coding the category right in:
<li><a href="http://yoursite.com/category/tutorials/">Tutorials</a></li>

or you can do:
<li><a href="<?php echo bloginfo('url'); ?>/category/blog">Blog</a></li>

If you do not have permalinks set up you'll have to use the id:
<li><a href="<?php echo bloginfo('url'); ?>/?cat=3">Blog</a></li>
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 09-29-2009, 08:35 PM Re: How does one call up a specific category in WordPress?
Average Talker

Posts: 25
Trades: 0
Perfect. Thanks!
Fudge is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How does one call up a specific category in WordPress?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.24450 seconds with 12 queries