Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to include a php file?

  • is under the path in wordpreewp-contentpluginsbuddypressbp-themesbp-default
    Now I want include some one from the path wordpresswp-contentthemesmythemename.
    How to write correctly? Thanks.

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

  • Roger Coathup
    Participant

    @rogercoathup

    Where do you want to write the code – is it in a file in your child theme?

    If the files are in the same directory, e.g. in your child theme folder, use something like:

    locate_template( array( ‘myfile.php’ ), true )

    It sounds though as though you are wanting to modify code in bp-default. You shouldn’t be modifying bp-default! All your changes should be in your child theme.

    Sorry. I lost paste some code. I forget use `backticks`.
    “ is under the path in wordpreewp-contentpluginsbuddypressbp-themesbp-default
    Now I want include some one from the path wordpresswp-contentthemesmythemename.
    How to write correctly? Thanks.


    Roger Coathup
    Participant

    @rogercoathup

    Have a look at this page:

    https://codex.wordpress.org/Function_Reference/bloginfo

    you want bloginfo(‘stylesheet_directory’) instead of TEMPLATEPATH

    Hello, I find the method.
    Use STYLESHEETPATH replace TEMPLATEPATH.
    Ho…la…

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to include a php file?’ is closed to new replies.
Skip to toolbar