Skip to:
Content
Pages
Categories
Search
Top
Bottom

Get stylesheet directory problem

  • @gcoulby

    Participant

    I know there are often questions about this but I’m confused by the format of the this structure. Taken from line 50 in “buddypress/groups/single/home.php”

    elseif ( bp_group_is_visible() ) :
    locate_template( array( ‘groups/single/members.php’ ), true );

    now at the moment I have copied a blank php file, which just has Test written in it, into that directory and changed the filename to this.

    elseif ( bp_group_is_visible() ) :
    locate_template( array( ‘groups/single/blankhome.php’ ), true );

    This changes the home landing page to “blankhome.php”

    However, I would like this file here: “[child theme]/groups/single/blankhome.php”

    I know you will need to use “get_stylesheet_uri” but I don’t know how or where to implement it.

    Can anybody help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • @karmatosed

    Moderator

    If you want it to use the child theme template you simply have that file in the child theme. You don’t have to link in the parent it simply will look to child first.

    @gcoulby

    Participant

    Thank you that worked fine, sometimes you just have to take the simple route!

    @hnla

    Participant

    Look up ‘locate_template()’ function in the WP codex as that would explain how things work, it ties in to the WP template hierarchy in that locate_template first looks for the path designated in the stylesheetpath (child theme) if not found there it then searches the templatepath (parent dir) ‘true’ or ‘false’ just designate how the file is required into the template ‘require’ or ‘require_once’

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get stylesheet directory problem’ is closed to new replies.
Skip to toolbar