php code to list titles?
-
This is an odd one, I guess.
I was wondering if there was some kind of code that could be inserted into the sidebar to list the names of different sections in your site. (Yeah, that’s as clear as mud!)
Maybe if I’m a bit more specific…
I need to have certain divs created for my sidebar. Each div has an id that matches the name of the section it’s used for, for example:
<div id="categories">
<div class="title">Categories</div>
category pages list here
</div><div id="archives">
<div class="title">Archives</div>
archive list here
</div>…and so on. Now, I know you can display the title of the blog on pages by putting the following code:
<?php bloginfo('name'); ?>
So I was wondering if there was a way to just show the titles listed above…so instead of putting in:
<div id="categories">
<div class="title">Categories</div>
category pages list here
</div>I could alter that by putting in something like:
<div id="<?php title('name'); ?>">
<div class="title">Categories</div>
category pages list here
</div>…that way my div would be named exactly what’s in the title of that section.
Does that make sense? If so, is there a way to do this?
- The topic ‘php code to list titles?’ is closed to new replies.