WordPress.org

Ready to get started?Download WordPress

Forums

Template Tag Location (15 posts)

  1. rvblog
    Member
    Posted 9 years ago #

    In what *.php file are all the template tags defined?

  2. Avenir
    Member
    Posted 9 years ago #

    In the /wp-includes folder there are a bunch of files named things like template-function.php, etc., etc. Look in these and you should be able to find all the source code for the template functions. You could also just look at the Codex for descriptions of how they operate:
    http://codex.wordpress.org/Template_Tags

  3. Kafkaesqui

    Posted 9 years ago #

    You can ask where a particular one is hiding in the source. Some of us have lightning-fast search reflexes. ;)

  4. rvblog
    Member
    Posted 9 years ago #

    wp_list_pages is an example of one of the tags that I am looking for in the source code but I'm don't know what *.php file it is defined in.

    I could search through every wordpress source file - I just thought someone may already know off the top of their head the file that I'm looking for - saving me a whole lot of search time.

    thanks

  5. Root
    Member
    Posted 9 years ago #

    Well with the right tool there is no search time involved.

  6. Kafkaesqui

    Posted 9 years ago #

    "wp_list_pages"

    template-functions-post.php - around line 300.

    And I'm with Root. A good text search utility is always on a source hacker's toolbelt.

  7. rvblog
    Member
    Posted 9 years ago #

    can you guys suggest a good search utility?

  8. Root
    Member
    Posted 9 years ago #

    Ideally you want a text editor with it built in. Depends on your tastes and platform. Loads of free editors all over.

  9. rvblog
    Member
    Posted 9 years ago #

    Do the search utilities that you are talking about search for text in a file that is loaded into the utility itself, or, does the utility search your entire hard drive for a certain text string inside of any file (like a *.php file)

    And can you recommend a good text search utility.

  10. Root
    Member
    Posted 9 years ago #

    I use PSPad

  11. rvblog
    Member
    Posted 9 years ago #

    Regarding the template tags issue - I'm still a bit confused here (and I hope that I don't sound too lame here)

    When coding a website using HTML, you simply add the HTML tag to an HTML page and your browser displays the results. The tag itself is not defined in your file - the tag is interpreted by the browser right?

    On the other hand, I take it that all the template tags that are listed on the codex site need to be defined individually inside of the WordPress source code? Is that correct?

    For example, if WordPress lacks a certain template tag feature and a new one is created, does the new tag have to be defined with WordPress in order to work?

  12. Root
    Member
    Posted 9 years ago #

    It depends how you want to call it. One is a pre defined function. The other would be a plugin.

  13. Root
    Member
    Posted 9 years ago #

    Can we go back one step and ask: Why do you need this? What do want to do ?

  14. rvblog
    Member
    Posted 9 years ago #

    In WP 1.5, Categories and Archives can be made to appear in a dropdown list - but "Pages" cannot.

    I've asked for a "dropdown_pages" tag to be included in WP but that could take some time before the next WP update comes out - and who knows if the requested feature will be included.

    I don't know anything about php coding - so I cannot create my own plugins ( I wish I could ) but I'm trying to learn how template tags works to see if I can figure out a way to get my "Pages" to appear in a dropdown list.

  15. Root
    Member
    Posted 9 years ago #

    With you. Now you have set out the challenge clearly lets hope a php guru finds it irresistible. Could be useful.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.