DeLiRiOuS Posted August 13, 2010 Share Posted August 13, 2010 Hi i'm comletely new to PHP and have what may be an easy problem to solve below is the code that makes the tabs at the top of the page. The first bit deals with the home tab, the second line makes more tabs based on the title of the pages in wordpress that you add, each time you add a new page to wordpress it takes the title of that page and makes a tab for it. <li<?php echo (!isset($_GET['page_id']) || intval($_GET['page_id']) == 0 ? ' class="current_page_item"': '')?>><a href="<?php echo get_option('home'); ?>/">Home</a></li> <?php wp_list_pages('title_li='); ?> My problem is that i want to add tabs that function like they're supposed to (proper mouse over and they turn black when the tab matches the page your on) but that i can make link to whatever link i want instead of just pages created in wordpress like if i wanted to make one tab that linked to http://www.atomicminddump.com/?cat=3 and another that linked to www.yahoo.com and so on, is there any way to modify the existing code to do that? Thanks a lot any help would be greatly appreciated! Thats basically it, if theres anything im missing or left out please let me know, thanks a lot for your help! Quote Link to comment Share on other sites More sharing options...
YourNameHere Posted August 13, 2010 Share Posted August 13, 2010 I think you can just add you get_links("title=") function to that and it will do the same as the get_pages() function. that way you can add links too and the tabs will open. However, if these are jQuery tabs with a remote url, it will break your tabs if you put in an absolute remote url as the href attr. (A local url will be called via AJAX, and will .load() into the tab div.) Quote Link to comment Share on other sites More sharing options...
DeLiRiOuS Posted August 13, 2010 Author Share Posted August 13, 2010 Thanks so much for your reply, i'll have to admit though everything you said went over my head, im totally new to php, all i know is html. The existing code came from a wordpress template. Could you tell me where i would add the get_links("title=") function and where i would insert the path to the link? the exact place i want to link it to is on my site is at http://www.atomicminddump.com/?cat=3 Thanks Again! Quote Link to comment Share on other sites More sharing options...
YourNameHere Posted August 14, 2010 Share Posted August 14, 2010 Thanks so much for your reply, i'll have to admit though everything you said went over my head, im totally new to php, all i know is html. The existing code came from a wordpress template. Could you tell me where i would add the get_links("title=") function and where i would insert the path to the link? the exact place i want to link it to is on my site is at http://www.atomicminddump.com/?cat=3 Thanks Again! It will be hard to do so without giving a long-winded lesson on Wordpress. I will give a site that has excellent tutorials on everything wordpress. The get_links() function (of wordpress) prints out (to the page) all your links (that you set up in your admin area) in <li><a href="?">?</a></li> format... This can be added to your tabs. To do so, I'm afraid you will need to do some research. It is out of the scope of this post to explain it all. So go through these series of tutorials and you should have little problem implementing what I am saying. http://www.wpdesigner.com/2007/02/19/so-you-want-to-create-wordpress-themes-huh/ This guy explains it the best i've seen. Sorry I cant help more but hopefully it sets you on your way to being able to figure it out. Quote Link to comment Share on other sites More sharing options...
DeLiRiOuS Posted August 15, 2010 Author Share Posted August 15, 2010 awesome! i put this in there and it worked perfectly <li><a href="http://www.atomicminddump.com/?cat=3">Word up!</a></li> thanks a lot! i thought it'd be simple i didnt realize it would be that simple, php is awesome! someday i should really learn it Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.