0
votes
1answer
48 views

Include a file that has a function in it

I am using include 'filename.php' to load a php file into a template file, simply because the original PHP template file was getting huge and I wanted to split up the sections into different files for ...
0
votes
2answers
48 views

Undo a function that is not (seemingly) hooked to an action?

I am using the popular Disqus plugin. To use this plugin effectively, they advise you to change the URL on the front page to end in #disqus_thread. I know how to easily do this in jQuery, but I ...
0
votes
1answer
134 views

Should I use include or load_template for including shortcodes, plugins and so on?

I am wondering what is the right way to include additional php files for theme options, shortcodes, plugins and so on. Both load_template and include will work, but what has better semantic value? ...
2
votes
1answer
177 views

Why does including a file in theme's functions.php not work?

For example, if I write some code (e.d. add a custom post type or something) in my theme's functions.php, it works fine. If I move it to a new file, then include() the file in my theme's functions.php ...
0
votes
1answer
68 views

file.php not loaded?

I feel like I'm being really stupid. I want to make use of some functions in wp-admin/includes/file.php (like download_url), but it doesn't seem to be included, not in the dashboard/admin, or in the ...
0
votes
1answer
232 views

Custom metabox not working

Morning! I have a call in my functions.php file to include a custom meta-box php file in my theme's directory called: /metaboxes/home-meta.php The code is as follows for the call: add_action( ...
0
votes
2answers
117 views

Including a PHP file via a function that is part of a plugin?

I struggled with this all day, and now am here... I have a contact form generated by including a php. Presently, I have this code in my theme's index.php to include it: if ( is_page('contact') ) { ...
0
votes
1answer
510 views

How to include a plugin's php file to another plugin functions file

I need to customize the output of the shortcode of plugin A by using a function of plugin B. So I alter the shortcode function of plugin A by inserting a condition to check the value of the function ...
2
votes
2answers
739 views

What is the most efficient method for loading widgets in functions.php

I have seen WordPress developers use two different methods for loading custom widgets from the functions.php file. The first: include("functions/my-custom-widget.php"); The second: ...
0
votes
2answers
3k views

Calling a Function in Functions.php from an external PHP script

Preamble I tried to make sure this question was not asked before. I'm new to using StackExchange so I may have failed in doing so. I don't mind rebukes; thick skin and I learn fast :) THE PROBLEM I ...
1
vote
2answers
6k views

Include PHP file in Content using [shortcode]

Here is what I have I am not having any lucking finding how to simply include a file in the content editor using a shortcode. For Example if I wanted to include form.php inside my Contact Page how ...
0
votes
1answer
243 views

How do I call an external php non WordPress class into functions.php?

All my WordPress files are in: /httpdocs/news/ and the classes I want to call are in: /private/classes/ Would I use the include_once() function or is there a WordPress function? And how would I ...
0
votes
1answer
518 views

can't access some worpress function from my plugin

I'm trying to write a relatively simple plugin. I have two php files, one is included within the other like this: define( 'PLUGIN_DIR', dirname(__FILE__).'/' ); include_once(PLUGIN_DIR . ...