The Entrepreneur Forum | Financial Freedom | Starting a Business | Motivation | Money | Success
  • SPONSORED: GiganticWebsites.com: We Build Sites with THOUSANDS of Unique and Genuinely Useful Articles

    30% to 50% Fastlane-exclusive discounts on WordPress-powered websites with everything included: WordPress setup, design, keyword research, article creation and article publishing. Click HERE to claim.

Welcome to the only entrepreneur forum dedicated to building life-changing wealth.

Build a Fastlane business. Earn real financial freedom. Join free.

Join over 90,000 entrepreneurs who have rejected the paradigm of mediocrity and said "NO!" to underpaid jobs, ascetic frugality, and suffocating savings rituals— learn how to build a Fastlane business that pays both freedom and lifestyle affluence.

Free registration at the forum removes this block.

Tweaking Wordpress - Navigation Bar

CMCarlin

Contributor
Read Fastlane!
User Power
Value/Post Ratio
8%
Jan 30, 2008
577
46
Alright, I want to do a very specific thing and I have a feeling that it is a lot simpler than what it's turning out to be. I've been googling on how to do it for the last few days, but before I pull (what's left of) my hair out I figure I'd drop a line here and see if anyone can help me.

I use Clean Copy Theme as of right now for one of my wordpress blogs.

I plan on posting different product categories into their respective categories (i.e. main product, product addon 1, product addon 2). Right now I have the home page as a static site with the blog posts set to a specific page.

Well the navigation bar in the header by default lists pages that you create. What I want to do is have that same navigation bar actually list a few hand picked CATEGORY pages.

I've looked up a few terms already such as:

adding categories to wp_list_pages
adding category posts to a specific page


plus many other terms that I can't recall. I've found a lot of websites that give snippets of code, but they either don't quite do what I want to do (they customize it too much or in a slightly different way) or the code doesn't work (it breaks my theme).

Anyway, I will keep searching and when I find the answer I will post it here.

I know the answer is right in front of me. It can't be that difficult to add a page that links to a category to the top navigation bar.
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

CMCarlin

Contributor
Read Fastlane!
User Power
Value/Post Ratio
8%
Jan 30, 2008
577
46
Re: Tweaking Wordpress - A little help please

Ask and you shall receive. After typing this post (literally a few seconds after) I tried a different search term and I found this page:

How to Add categories to Nav Bar in Wordpress Blog | Nihar's World

My theme has nav_menu.php file. This file contains the menu code. I have put the following code in this file:
Code:
1
wp_list_categories('orderby=name&include=3,25,42,11,10&title_li=');
I am only including some categories. I have specified the categories that i want to include using “include=3,25,42,11,10″ parameter.

Each Category is assigned with a Category ID. To find the category id, just go to Posts -> Categories and hover over the title of the Category. The status bar of your browser will display a URL with a numeric ID at the end. This is the Category ID. You can see from the below url: 3 is the cat id.

http://www.yourdomain.com/wp-admin/categories.php?action=edit&cat_ID=3

wp_list_categories generates each category as list <li>..<li/>. It marks the current category with HTML class current-cat.


I don't have time to implement this and test it, but I'll let everyone here know how it works out.

For the sake of discussion, feel free to add anything here (experiences, questions, etc....)
 

TC2

Contributor
User Power
Value/Post Ratio
12%
Jun 30, 2008
703
87
Phoenix, AZ
A+

That's great finding. I don't have complicate category structure and I don't change that often, so I manually add to my template.
 

CMCarlin

Contributor
Read Fastlane!
User Power
Value/Post Ratio
8%
Jan 30, 2008
577
46
You know it's funny, in my quest to learn more about wordpress tweaking and by extension PHP (which I know nothing about), I never bothered to try to learn how to do it manually (which I assume is pretty basic). I like the idea of using code and the challenge and thrill of learning something new caused me to go for the more 'difficult' route.
 
Dislike ads? Remove them and support the forum: Subscribe to Fastlane Insiders.

CMCarlin

Contributor
Read Fastlane!
User Power
Value/Post Ratio
8%
Jan 30, 2008
577
46
Ok so I tried this out and it seemed to put the word 'category' into my navigation bar, which looked ugly and out of place. Here is the modified version:
Code:
 <?php wp_list_categories('orderby=name&include=3&title_li='); ?>


Easy Peezy!
 

CMCarlin

Contributor
Read Fastlane!
User Power
Value/Post Ratio
8%
Jan 30, 2008
577
46
Ok so I came across a plugin that achieves what I want without having to change wp_list_pages to wp_list_categories, which gives me far more flexibility. Here it is:

Information Takes Over » Blog-in-Blog Wordpress Plugin

I basically create a new page, insert one line of code and it displays all posts from within a specified category on that page allowing me to further treat my wordpress site like a CMS. It works pretty good :)
 

Post New Topic

Please SEARCH before posting.
Please select the BEST category.

Post new topic

Guest post submissions offered HERE.

Latest Posts

New Topics

Fastlane Insiders

View the forum AD FREE.
Private, unindexed content
Detailed process/execution threads
Ideas needing execution, more!

Join Fastlane Insiders.

Top