The tag has no wiki summary.

learn more… | top users | synonyms

1
vote
1answer
17 views

include php file if page_id matches

I think this is a simple question: I'm building a plugi, and up until now, if i wanted to include a php file, i would have to know the page_id - i would put the following command in page.php (or ...
1
vote
3answers
2k views

Include a external PHP file into a Wordpress Custom Template

Is this even possible? I mean, im trying to add a blog into my site.. I already have the header,footer and sidebar layout in my site. can i use those in my custom wordpress template? <?php /* ...
0
votes
0answers
10 views

Pages included in another page and duplicate content issues for SEO

in a recent project I've decided to create a page template (PageX) which is a kind of "stack" of subpages. This template simply includes the content of three other separate pages (PageA, PageB, ...
0
votes
1answer
520 views

<?php the_author(); ?> not working outside the loop

I have the following code on index.php and I want to include this line of code (bellow) to display author info on top of the loop. <?php include 'author-top.php'; ?><!--author--> I ...
0
votes
0answers
15 views

Cant create table if including the file in main script

I want to create a table by including the script that creates it in the main plugin file. I have this: register_activation_hook( __FILE__, 'vkrwps_agt' ); function vkrwps_agt() { global $wpdb; ...
0
votes
0answers
10 views

including php file from payment gateway

I'm implementing a payment gateway called point, is a Swedish company. Everything is fine with this files, because I already tested outside of wordpress.<> But now that I'm implementing this on ...
0
votes
0answers
14 views

Linefeed added after include/require in PHP

I am using the following script to protect downloads from the wp-upload dir: (https://gist.github.com/hakre/1552239) It should work fine, however there is a linefeed created by the ...
0
votes
1answer
26 views

Include a php file that is above WP installation hierarchically?

I've come across a number of ways to call the WP "root" folder But what if I want to include a php file that is in a parent folder of WP? Example http://www.site.com/, where the WP blog is in ...
0
votes
1answer
34 views

PHP help get_template_directory + PHP include

Sorry my PHP skills are lacking. I want to use a php include in WP but I'd like to get the file path with <?php get_template_directory(); ?> I can't figure out how that would look. My non WP ...
0
votes
1answer
18 views

How can I include a file related to blog URL? Nothing seems to work

When I was building my website locally using WAMP, I was just using simple include '/extras/file.php'; Of course, that would start at the root folder, and look in the extras folder. However, now ...
0
votes
0answers
47 views

Custom plugin breaks css.php on Multisite

I got a strange problem on a Multisite Install I run. Everything works perfectly fine (Domain Mapping, Caching, whatever functions and Plugins I use, both forced and chooseable). To enhance the ...
0
votes
1answer
44 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 ...
2
votes
1answer
129 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
35 views

Why does abstracting html from plugin code result in loss of access to wordpress functions?

When defining the callback that produces the HTML content for an admin settings page, I'd like to abstract the HTML into a separate file, but the HTML uses some wordpress functions, specifically ...
0
votes
0answers
10 views

How to include taxonomy.php from wp-includes the proper way? [duplicate]

I tried including taxonomy.php from wp-includes folder in my custom php script (which is called by jquery) but I get this error: Fatal error: Call to undefined function add_action() in ...
0
votes
1answer
31 views

How to query posts to include specific pages of one post type, and all pages of another post type?

I'm having trouble figuring out how to query all posts from the post type "events", as well as including four specific pages in the loop. If I use the "include" parameter, it only returns the ...
0
votes
3answers
479 views

Looking for a way to include/embed text from a file on a page so that the short codes are processed

I'm using WP as a CMS. I've got multiple pages that share the same header. group 1 has header 1. group 2 has header 2. etc. I've looked at these two plugins for a quick way to insert a combination ...
0
votes
2answers
43 views

Including php file in directory above WordPress installation

I'm having trouble including an external .php file into my WordPress theme. WordPress installation URL: mydomainname.com/blog PHP File URL: mydomainname.com/testing/assets/inc/analytics.php I'm ...
0
votes
1answer
260 views

ob_get_clean returns empty string, ob_get_flush outputs string

I am utilizing a template-type system, to filter the_content. My filter contains this partial code: ob_start(); include_once ( self::$dir . 'views/templates/' . $post_type . '/' . $display . '.php' ...
0
votes
1answer
123 views

Include content from one page to another

I'd like to include content from one Page (named "contact_text") to another Page in a specific spot (both of these are WordPress admin pages). I've followed this Stack Overflow thread. However I ...
0
votes
1answer
111 views

Issues with wp_enqueue_script and jquery-ui

wp_enqueue_script('jquery-effects-shake'); ..doesn't seem to work, no matter where I put it. I've tried the following and lots of googling: function my_callback() { ...
0
votes
3answers
823 views

Adding rich text editor to my plugin

Hello Wordpress users, I'm trying to add a rich text editor to my own plugin. So I googled it first of course and I found serveral answers like: ...
2
votes
2answers
89 views

How can I avoid code duplication for a blog with lots of source code?

I'm writing a tutorial on using the R language to do some applied statistics. An example post is: http://mcmcinirt.stat.cmu.edu/archives/223 I would like to have all of the blocks of source code be ...
0
votes
1answer
41 views

What is the right way to include a wp-admin file in your theme?

I'm trying to use wp_delete_user() in my theme, to allow a user to delete their account from the front-end. Turns out that the wp_delete_user() is not defined unless /wp-admin/includes/user.php has ...
0
votes
0answers
307 views

show Visual form builder in the front end

Iam anew in wordpress . i used this plugin http://wordpress.org/plugins/visual-form-builder/ to build custom pages then i tried to build a custom page called formbuilder.php to use it in the front end ...
0
votes
2answers
47 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
46 views

Trying to include files in plugin isn't working

I've created a simple site specific functions plugin but I'm having some trouble including additional files to it. Basically I'm trying to keep things separated so I've got one php file for general ...
0
votes
2answers
134 views

How To Display Selected Terms For Custom Taxonomy?

This may be a syntax problem but if so I can't see the problem. I want to select specific terms of a custom taxonomy and display their names. I'm having a problem with the selection process in the ...
0
votes
1answer
88 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? ...
0
votes
2answers
837 views

How to prevent wordpress from loading old versions of jquery in wp_head();?

I noticed my twenty twelve theme is including outdated versions of jquery and js so I want to replace the scripts with the newer versions, however the scripts are in the file included by wp_head() ...
-3
votes
1answer
836 views

How to rename wp-includes folder?

Is there a way that we could rename wp-includes folder I have found out there are ways to do for other folders. But how do we do it for wp-includes folder? ...
0
votes
1answer
61 views

ERRORS! include() [function.include]: Failed opening

After migrating my site from a development server to the live site, I'm getting a massive amount of PHP errors. None of these were apparent on the development site. http://www.martialartsevents.ca ...
0
votes
1answer
187 views

is_plugin_active() returning false on active plugin

So I have the following in an include in my theme file: include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); if ( is_plugin_active( WP_PLUGIN_DIR . '/woocommerce/woocommerce.php' ) ) { ...
0
votes
1answer
81 views

Want to include ad code after related post

I want to include ads HTML code after related post plugin. My site my single.php code below: <?php if ( ...
0
votes
1answer
110 views

Three step order form, how to go to next step

I have an order.php that is in fact a custom page template. This template loads the first step of my order form via: <?php include('order/order-step-one.php'); ?> Now in this ...
23
votes
4answers
10k views

Passing Variables through locate_template

While I've typically used include or require on their own to save long term code maintenance I've started to use get_template_part and locate_template as using built in WordPress stuff is always best. ...
0
votes
1answer
99 views

php include not working in custom page

The Problem I have a db.php file which contains mysql login details. I want it in a separate file like this so it can be linked in several different pages for easier tracing later. This all works ...
0
votes
1answer
47 views

Include paths and functions for external scripts

I try load external script as plugin , the idea it´s use one easy plugin and call script and load this script into admin but i have problems with some configuration files and css files , in the case ...
0
votes
0answers
38 views

add_action inside include

I have the following include in a plugin class function: include( plugin_dir_path( __FILE__ ) . 'templates/fancybox-player.php'); I have in this include the following code: // Load js and ...
0
votes
0answers
23 views

Insert blog template on home template [duplicate]

i need to include "blog_page_2_column.php" into homepage. I insert this into homepage template: <?php include(TEMPLATEPATH . '/blog_page_2_column.php');?> Works fine but i cant change the ...
0
votes
2answers
4k views

Firebug says jQuery is loaded but $() and jQuery() are not defined

I'm trying to test my wordpress page with some simple jQuery script but it won't work. I've loaded the script with wp_enqueue_script('jquery'); in functions.php as explained in the wordpress guide ...
2
votes
1answer
68 views

nowplaying.include.php Will Not Display Results

Cyberchimps.com recommended I post here as they believed there may be a global issue with my request. I thought what I was missing was obvious and simple, but two months into this and being referred ...
0
votes
2answers
1k views

Order by & include array by specific post ids

I have the following: <?php $num_cols = 2; // set the number of columns here $args = array( 'post_type' => 'testimonials', ...
0
votes
1answer
38 views

Is it ok to chop index.php and include files?

So in my index.php I called get_header(), get_sidebar() and get_footer(). My index.php is kind of huge. It is separated into 5 divs more. How do I make it cleaner? Is it safe to chop it to files and ...
0
votes
2answers
49 views

Post's ID pattern?

Each post has an ID and I would like to know how they were assigned. Is there a pattern? Why are the ID's not being incremented by 1 every posts? It would be easier..My ID's go from 9867, to 9869, to ...
1
vote
1answer
2k views

ABSPATH not working! Any idea why?

This is what in my wp-config.php : if ( !defined('ABSPATH') ) define('ABSPATH', dirname(__FILE__) . '/'); I am calling from plugin/pluginName directory to : require_once( ABSPATH . ...
0
votes
1answer
55 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
71 views

post content includes and seo vs. duplicate content

Trying to find the answer here but can't seem to locate this specific scenario... We have products that include multiple, defined resources - for example, each has 3 distinct user guides for ...
0
votes
1answer
184 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( ...
7
votes
3answers
749 views

Is there any way to use get_template_part() with folders?

I'm wondering if there is any way to use get_template_part() with folders? My main folder has a lot of files now because I put every re-usable element in a separate file. I'd like to put them in ...