Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9132713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:21:38+00:00 2026-06-17T08:21:38+00:00

WordPress / PHP related question. I have a WordPress plugin that uses dirname(__File__) to

  • 0

WordPress / PHP related question.

I have a WordPress plugin that uses dirname(__File__) to retrieve some .js files from a theme folder.

The theme folder has a space in the name ie: “My Theme”.

dirname(__File__) appears to be ignoring the space and is trying to load /MyTheme/script.js and so the script is not found.

Any help to rectify this problem (without removing the space from the directory name) would be much appreciated.

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:21:39+00:00Added an answer on June 17, 2026 at 8:21 am

    To start with, as others have said, spaces in file paths are not good. Second a WordPress plugin should never be tied to a specific theme.

    If the plugin is theme specific, you should just include it in the theme’s functions.php, that way you have easy access to everything in the theme

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Quick question about Wordpress PHP: I am writing a theme and I want to
I currently have a custom page in Wordpress (with the PHP Execution plugin). On
I have an admin page for a WordPress plugin that, thanks to the stackoverflow
In my Wordpress post page, I have added a second loop that displays related
im creating a wordpress plugin that have users to login and upload the file
I have 10 websites with different PHP related platforms like in Drupal, Joomla, Wordpress
There seems to be a bug in a Wordpress PHP function that leaves whitespace
I'm a newbie in php and Wordpress. I'm trying to create a script that
I have created a searchfrom.php for wordpress but then it's giving me a false
I used Firebug to inspect the HTML my php(using wordpress) files created. According to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.