Skip to:
Content
Pages
Categories
Search
Top
Bottom

[resolved] locate_template and child theme chaos

  • I am doing a child theme and have a loop for displaying posts with a really odd effect and not sure if i’m missing something or if I’ve found a bug. Heres the code on my posts loop in archive.php

    http://pastebin.com/8wpwTZeM

    Using locate_template in this way causes the template to only render once when looking at a tag / category / etc archive (Yes there are a lot more than one post in said archive). If I do the it works fine rendering the template for every post as would be expected. One obvious side effect being the TEMPLATEPATH gives me the parent theme’s template which obviously is not what I want. Takers on this? I’m really at a loss here.

Viewing 6 replies - 1 through 6 (of 6 total)

  • nit3watch
    Participant

    @nit3watch

    use something like http://pastebin.com/ and past the link to the code here.


    r-a-y
    Keymaster

    @r-a-y

    Use STYLESHEETPATH instead of TEMPLATEPATH.

    @r-a-y it works, you obviously came across this before and it makes sense now that I see it. It really seems a bit off and hackish though, is this an issue with locate_template, buddypress or a “feature”?


    r-a-y
    Keymaster

    @r-a-y

    Your problem with locate_template could be your leading slash.

    Try without and see what happens:
    locate_template( array( 'library/components/buddypress/buddypress-postloop.php'), true)

    locate_template() is a WordPress function, so any bug with it would be a WordPress issue.

    @r-a-y nope removing the leading lash results in the same single render issue. The STYLESHEETPATH seem to be the way to do it for now and this does seem to be a WordPress issue with locate_template() so I’ll take that up over in their neck of the woods. Thx for the help, I was banging my head for over an hour.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[resolved] locate_template and child theme chaos’ is closed to new replies.
Skip to toolbar