WordPress.org

Ready to get started?Download WordPress

Forums

Category links in header (4 posts)

  1. JBo796
    Member
    Posted 1 year ago #

    Hello,
    I am new to PHP (most of my programming is done in ASP.NET and C#) so please bear with me. I am trying to add a horizontal list of my categories in my header, but am having some issues. Currently I am using the "list_cats" function (http://codex.wordpress.org/Template_Tags/list_cats) (which works, except I can't change the font color in the CSS, only the font size and font family). Anyways, the list_cats function is saying it is depreciated and any of these functions (http://codex.wordpress.org/Function_Reference/) should be used instead, but I can't get them to work.

    (I hate being a n00b again). Thanks in advance.

  2. esmi
    Forum Moderator
    Posted 1 year ago #

  3. JBo796
    Member
    Posted 1 year ago #

    Ok, that helps. So when it displays my categories, it actually says the word "Categories" above them. How do I remove that?

    <html>
        <head>
            <title>Tutorial theme</title>
            <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
        </head>
        <body>
            <div id="wrapper">
            <div id="header">
            	<div style="float:left; top:5px;">
       		    	<img src="/wp-content/themes/tutorial_theme/images/logo.png" width="405" height="210" alt="ok">
                </div>
                <div style="float:right;">
    
                	<div id="categorylist">
    
    <ul>
    						<?php wp_list_categories( $args ); ?>
                        </ul>
                        </div><!-- end of categorylist -->
                        <h1><a>"><?php bloginfo('name'); ?></a></h1>
                     </div>
                <div style="clear:both;">
                </div>
            </div>

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]

  4. Spencer Cameron
    Member
    Posted 1 year ago #

    You want the title_li attribute.

    Like this:
    wp_list_categories( array( 'title_li' => "" ) );

    You can set title_li to display any arbitrary text/html you'd like. Setting it to an empty string ( "" ) makes it disappear altogether. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.