• I have the design for my blog set up so that for certain pages, links appear differently in my header. This means that I have a <body=”example”>, so that html can distinguish what the links should look like. So for single post pages, I want to be able to set “example” to the category name. Is this possible?

    Thanks so much for the help.

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’m looking to do something similar with my pages. I was hoping to find something akin to MovableType’s encode_html, a modifier that allows the output to be more html friendly. Unfortunately, none of my searches of the codex has turned up anything.

    What I’m trying to do
    Let’s say that I have a page title “About Us”. I’d like to have it display as “about-us”.

    Any thoughts?

    Found the fix via php.

    I’m working with pages and parent titles, so I first have to determine the title of the parent page. Once that’s done then I echo back the page title in lower case and replace the spaces with “-“

    <?php
    $parent_title = get_the_title($post->post_parent);
    echo(ereg_replace(" ","-",strtolower($parent_title)));
    ?>

    This will work with any code that you’re using if you’re echoing a variable. Just replace “$parent_title” in the second line with the variable you’re using.

    Hope that helps!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pulling the category title for html’ is closed to new replies.