Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   Adding page and category navigation in page footer (http://forum.bytesforall.com/showthread.php?t=7336)

rjh4242 May 29, 2010 06:58 PM

Adding page and category navigation in page footer
 
Hi there
Sorry if this post is in the wrong place - I couldn't figure out the correct forum for questions about footer content and formatting, which is probably where this belongs.

I am really impressed with the Atahualpa theme - I've only been playing with it since yesterday and I'm finding it has almost all the customisation I need.

One thing I haven't been able to find, however, is how to sort out the text navigation links I want to put in the page footer. I'm aiming for just a simple horizontal row of links in the footer, linking to each of the top level pages and categories on the site.

I found a post on how to get one menu bar showing both pages and categories, which works well and sorts out the menu bar at the top of the page, but I haven't been able to figure out how to do the same in the footer without messing with the code, and also I'm having to specify each page and category individually rather than just asking for all top level pages and categories.

At the moment, I am specifying each page by id in the footer using %page-nn%, but I'd really like to be able to generate the list automatically, the way the menu bar does. Also, there doesn't seem to be a way to specify categories at all. As a workaround, I've added code to bfa_footer.php to allow specification of categories by id in a similar way to the way pages are specified, by adding a new function:
Quote:

function footer_category_links($matches) {
$category_id = $matches[1];
$category_data = get_category($category_id, ARRAY_A);
$category_title = $category_data['cat_name'];
$category_url = get_category_link($category_id);
return '<a href="' . $category_url . '">' . $category_title . '</a>';
}
and inside the bfa_footer function adding the following
Quote:

if ( strpos($footer_content,'%category') !== FALSE ) {
$footer_content = preg_replace_callback("|%category-(.*?)%|","footer_category_links",$footer_content);
}
Am I missing something - is there some simpler way to do this? I tried adding the following php code to the content of the footer but it didn't produce any output:
Quote:

<?php
wp_list_pages('title_li='); ?>
Thanks for any suggestions


All times are GMT -6. The time now is 07:48 AM.

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