• Resolved ralph23

    (@ralph23)


    I’m trying to build a breadcrumb system into my new theme, but I’ve run into a problem. This is part of the code I’m working with, it is in my functions.php file:

    if (!is_home()) {
    		echo '<a href="';
    		echo get_option('home');
    		echo '">';
    		echo 'Home';
    		echo "</a> &raquo; ";
    		if (is_category() || is_single()) {
    			echo single_cat_title();
    			if (is_single()) {
    				echo " &raquo; ";
    				the_title();
    			}
    ...

    For some reason, the category does not display at all. When running the above code on a single page, I get:

    You are here: Home » » Page Title Here

    Does anyone know whats up> WP 2.7 if it matters.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Put this before the first ‘if’:

    if (is_category) {
    $cat = get_query_var('cat');
    echo 'category is ' . $cat;
    }

    To see what category WordPress thinks it is querying.

    Thread Starter ralph23

    (@ralph23)

    After a little playing around, got it. Thanks for the help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem With Displaying Category’ is closed to new replies.