• I’d like to add a file branding.php It would act exactly as the functions.php allowing me to customize login page and dashboard.

    I’d like this to be a separate file rather then putting it into the functions.php

    I really don’t see where the functions.php is called from.

    I’d also like to maybe put it in the wp-admin folder or somewhere not reliant on theme.

    Where should I put this file, and what code should I add to call it?

    Thank you in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The functions.php file is called from somewhere deep in the inner workings of WordPress (it’s not that hard to find really, but I haven’t needed to look that far into it yet).

    To include another file, you can edit your functions.hp file and add in this line (example only… please check on your own system before you do anything).

    require_once( __DIR__ . 'branding.php' );

    Of course, if you’re going to do this the right way you really should be using a child theme, and then you can add anything that you want into that child theme’s functions.php file and it will be included automatically.

    Thread Starter Orange Web Dev

    (@orange-web-dev)

    @catacaustic Thanks.

    I’m sure it isn’t to hard to find. I just thought someone on here might know off hand.

    I am using a child theme. But I’d like for this file to be called to outside of theme if possible.

    I know it’s the proper WP way. But I still don’t like the idea of something more back-end being associated with a front end theme. because i’m not changing the front end theme.

    Any code in themes doesn’t differentiate between front and back end unless you tell it to.

    If you only want it for the admin area, wrap the require() statement in a check for is_admin().

    if( is_admin() ) {
        require_once( __DIR__ . 'branding.php' );
    }

    The other option is creating your own plugin that contains your code. That will let you do whatever you need to with it, adn it won’t be theme-dependant.

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

The topic ‘duplicate functions.php renamed diff folder.’ is closed to new replies.