Wordpress question

treason

Junior Member
Joined
Mar 4, 2009
Messages
105
Reaction score
120
anyone know how to move categories to the top menu?
 
go to themes --> widgets and just click on it and you should get the compass rose like crosshair, you can then move it around.

if it is not showing up int eh sidebar then create the sidebar on your own by adding it from the left side of that menu
 
thanks for the help but I guess my question was ambiguous.

what i meant was, the categories is currently placed on the right side of my site.

I want to move it where the header is located that displays the top menu.
 
Find the place in the header HTML code where you want to display your cats and then use this code
Code:
<?php wp_list_categories(); ?>
that should do it :)
 
thanks, but that didn't work.

here's the original header.php code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> <?php if ( is_single() ) { ?> » Blog Archive <?php } ?> <?php wp_title(); ?></title>
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats -->
<meta name="keywords" content="<?php bloginfo('description'); ?>" />
<meta name="description" content="<?php bloginfo('description'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory');?>/style.css" type="text/css" media="screen" />
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory');?>/top.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory');?>/style-switch.js"></script>

<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<?php
global $page_sort;
if(get_settings('Chimera_sortpages')!='')
{
$page_sort = 'sort_column='. get_settings('Chimera_sortpages');
}
global $pages_to_exclude;

if(get_settings('Chimera_excludepages')!='')
{
$pages_to_exclude = 'exclude='. get_settings('Chimera_excludepages');
}
?>
<?php wp_head(); ?>
</head>
<body>
<div id="container">
<div><img src="<?php echo get_option('home'); ?>/wp-content/themes/Chimera/img/spacer.gif" alt="<?php bloginfo('name');?>" width="361" height="10" border="0" /></div>
<div id="header">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="191" rowspan="3" align="left" valign="top"><a href="<?php echo get_option('home'); ?>/"><img class="main-logo" src="<?php echo get_option('home'); ?>/wp-content/themes/Chimera/img/spacer.gif" alt="<?php bloginfo('name');?>" width="970" height="115" border="0" /></a></td>
<td width="100%" align="right" style="padding:15px 10px 0px 0px;" valign="middle">
<script type="text/javascript">
function clearDefault(el) {
if (el.defaultValue==el.value) el.value = ""
}
</script>
</td>
</tr>
</table>
<div class="top-Menu" id="chromemenu">
<ul>
<li><a href="<?php echo get_option('home'); ?>/">Home</a></li>
<?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'.$pages_to_exclude)?>
</ul>
</div>
</div>
<div id="wrapper">
<?php include 'sidebar.php';?>

thanks in advance!
 
At the bottom of your code snippet, replace
Code:
<?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'. $pages_to_exclude)?>
by
Code:
<ul>
<?php
wp_list_categories('orderby=name&include=3,5,9,16'); ?> 
</ul>
In the above code snippet, change 3,5,9,16 by the IDs of the categories you want to display
 
thanks for the help mate, but unfortunately, I still get the same result.
 
Try this:

Code:
<div class="top-Menu" id="chromemenu">
<ul>
<li><a href="<?php echo get_option('home'); ?>/">Home</a></li>
<?php wp_list_pages('title_li=&depth=1&'.$page_sort.'&'. $pages_to_exclude)?>
</ul>
<ul><?php wp_list_categories('title_li='); ?></ul>
</div>

As you can see, I just added the following line below the first unordered list in the chromemenu div:

Code:
<ul><?php wp_list_categories('title_li='); ?></ul>

This will create a second unordered list for your categories, and they should be displayed horizontally like the pages. You must keep the ('title_li=') part because otherwise, it will add the word "Categories" to your menu.
 
I still get the same result :(

thanks for your help though.
 
NEVERMIND, it works :D
I just had to also edit the code on home.php.

thanks!
 
Back
Top