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 9025515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:17:27+00:00 2026-06-16T06:17:27+00:00

Hey guys I have a plugin and its displaying info on /courses.php (using theme)

  • 0

Hey guys I have a plugin and its displaying info on /courses.php (using theme)

How can I get it to display info on /courses/single_course.php

I figured I’d just have to make a /courses/ folder in theme and have single_course.php inside that. However this doesn’t seem to work.

I’ve tried googling but I’m struggling to figure out the keywords to solve this problem! ^_^

OK edit cause nobody is understanding:

  • I have plugin working. This is a custom plugin
  • I want to know how to make the following work http://www.example.com/plugin/index.php http://www.example.com/plugin/index.php
  • Currently to make http://www.example.com/plugin work you just need to create plugin.php in the theme directory and give a callback to a function in the plugin.
  • Creating /wp-content/theme/themename/plugin/index.php did not work as anticipated.
  • 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-16T06:17:28+00:00Added an answer on June 16, 2026 at 6:17 am

    WP uses specific directories for placing its themes and plugins tom maintain organization standards.

    // Pointing to theme WP themes directory
    $_SERVER['DOCUMENT_ROOT']."/wp_content/themes/"  
    // Pointing to theme WP plugins directory
    $_SERVER['DOCUMENT_ROOT']."/wp_content/plugins/"
    

    or you can use the built in functions in wordpress

    // for themes in any php file after headers
    get_template_directory_uri() . '/js/custom_script.js'
    // for plugins in you main plugin class
    plugins_url('/js/newscript.js', __FILE__);
    

    I would recommend keeping plugins in plugins and themes in themes. What you may be looking for is creating some extra plugin features which will require you to include you extra php functions and classes when the plugin in question is loaded.

    First create a folder in under your plugin directory and chmod it with proper web securities

    cd /path/to/wordpress/install/wp-content/plugins/your-plugin/
    mkdir php
    chmod 755
    

    Next either copy or create and edit the new single_courses.php file. I’ve listed a quick method below if you are creating the new file from scratch. Otherwise just cp it over. In both cases we need to insure proper web access right using chmod.

    cd /path/to/wordpress/install/wp-content/plugins/your-plugin/
    echo -n "/*Extra Plugin Functions*/" > single_courses.php
    chmod  644 single_courses.php
    

    Now we need to be sure to include the new file in our main plugin file

    /* Main Plugin File :: ./wp-content/plugins/your-plugin/theplugin.php */
    ...
    include_once $_SERVER['DOCUMENT_ROOT']."/wp_content/plugins/you-plugin/php/single_courses.php"
    ...
    

    Thats the basic way to go about it. Use the same process for hooking theme php files as well. Always make sure when creating directories and files on your server that proper security is put into effect or you open up your web directory and or server to get hacked.

    Hope it helps…

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

Sidebar

Related Questions

Hey guys i'm using this plugin from Hawkee. Its like twitter where you can
Hey guys I have an older site that is coded in AS2(I can't get
Hey Guys. I have got a problem on using the jquery auto-complete plugin.my problem
Hey guys I have one more question lol. I am using a script that
Hey guys I have an ajax jquery function that receives data from a php
Hey guys I have one php exec command that works on my remote linux
Hey guys I have a gridview and below it 4 textboxes I'm using to
Hey guys I have enabled APC on my VPS but now I can't access
hey guys, i have a certain plugin on my website that adds a inline
Hey guys i have 6 checkboxes and am using their rel= values to add

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.