is there a page-title tag or page-slug tag?
-
Hi,
I’m struggling to find a tag to identify my current page.
I am trying to dynamically insert an id into my HTML
<body>tag so that horizontal menus can pick up unique css selectors, and render the relevant menu tab with a different background colour (as can be seen on http://binarybonsai.com). The tag would read differently depending what page I am on e.g. <body id=about>as codex has been down for some time, I've relied on the wiki docs for tags, which make no reference to any page tags. All I can find is the wp_title tag, but this seems to have some spaces padding the text. I'm not a PHP developer (if only WP were written in Java!). I've tried trimming the white space but this seems to give me an empty string :-( This is what I tried.
<body id=”<?php trim(wp_title(”, TRUE)); ?>”>`
Is there a tag to identify the page name or ideally the page-slug name?
BTW, WP is a great application.. Well done. If only I had a time to learn PHP!
The topic ‘is there a page-title tag or page-slug tag?’ is closed to new replies.