Forum Replies Created

Viewing 2 replies - 91 through 92 (of 92 total)
  • Thread Starter breathelifein

    (@biellebrunner)

    Ok. Another thing.
    I’d like to have the categories displayed before the title of a post when in a single page.
    Like “Parent Category ? Child Category ? Post Title”. When I tried just using the get_category_parents function like:

    <span class="title">
    	<?php echo get_category_parents($cat, TRUE, ' ? '); ?> <a
    href="<?php echo get_permalink() ?>" rel="bookmark" <?php the_title();
    ?>><?php the_title(); ?></a>
    </span>

    it didn’t work and I got the error “catchable fatal error: object of class wp_error could not be converted to string in /home/…/single.php on line 7”.

    Is there anyway to do that?

    Thread Starter breathelifein

    (@biellebrunner)

    Thank you. It works perfectly.
    Just one more question: is there any way to not get a ? after the last category is displayed? So it’d be “Parent Category ? Child Category” instead of “Parent Category ? Child Category ? “?
    Thanks.

Viewing 2 replies - 91 through 92 (of 92 total)