The tag has no wiki summary.

learn more… | top users | synonyms

-2
votes
3answers
47 views

Shortcode return is printing a 1 afterward

function build_total_search_method( $atts ) { $shorcode_php_function = include( dirname(__FILE__) . "/includes/total_search.php" ); return $shorcode_php_function; } add_shortcode( ...
0
votes
1answer
132 views

Add page as static html into another page

Is there a way to include a wordpress Page into another one? I'm not just talking about getting the content using get_page(), but to import the whole page (theme + content). I have been looking around ...
0
votes
1answer
24 views

Wordpress blog set up

I plan to launch my website with multiple blogs plugged into it, with a main index page for all posts. I currently have the index running from the root and two blogs running within their own folders ...
0
votes
1answer
507 views

Creating plugin using simple_html_dom parser?

I'm running into a problem with my plugin which is essentially an admin page that includes simple_html_dom parser to edit some information scraped from some websites. Let's assume I want to parse ...
0
votes
3answers
77 views

How and when to include shortcode source files

I am Writing a plugin, with many shortcodes. Now I do not want to include all shortcodes source files to every page. So my questions are: Where should I include the source? Is it back-end or ...
0
votes
1answer
1k views

bloginfo('stylesheet_directory') vs. get_stylesheet_directory_uri() and include('file.php') vs. get_template_part()

In my custom theme I'm using <img src="<?php bloginfo('stylesheet_directory'); ?>/images/logo.jpg"/> to load my custom logo. I'm using a custom sidebar for front-page.php and that's why I ...
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 ...
2
votes
1answer
207 views

Conditional Ajax inclusion

I have a custom interface that uses 30+ ajax files while running... some files are only used in category.php while othere's are only used in page.php... i include the ajax loader php files in my ...
0
votes
1answer
97 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 ( ...
2
votes
1answer
119 views

Include files for a plugin not including

I have a plugin which I need to include a file in but it doesn't include. Here's the example of the tree: plugin folder /themes /folder2 /somefiles /includeme.php Within themes is ...
1
vote
1answer
540 views

Sort users in get_users() in custom order

<?php $blogusers = get_users('include=5,6,2,7,12,8'); foreach ($blogusers as $user) { ... } ?> Right now these users will sort by first name. How do I sort this the order the numbers ...
0
votes
1answer
144 views

Include multiple custom post types [closed]

Hi i want to include 2 different custom post types in my functions files: include("portfolio/portfolio-post-type.php"); include("gallery/gallery-post-type.php"); But they seem to break ...
1
vote
0answers
56 views

Jetpack breaks including post (via permalink)

On another website, I've been dynamically including posts <?php include '[post].php' ?> via the permalink, from my Wordpress site. I recently installed the Jetpack plugin for my Wordpress site, ...
2
votes
2answers
101 views

I need to add a custom “cover” to every new post — plugin or custom setup?

I'm creating a site that's basically like an online book, and every post is a chapter. Each chapter gets a customized, specially designed "cover" page that can't really be designed in the Wordpress ...
0
votes
1answer
113 views

Custom meta box includes

I am having some problems including files for my custom meta boxes. I have a structure like so: post-meta.php cmb teaser_meta_box load.php initiate.php display.php save.php So ...
-1
votes
1answer
407 views

Adding a wp_head hook from an included PHP file

I am using a WordPress plugin for including PHP code within posts and pages, and it's working great - however, I need to insert some styles and scripts, and in order to do that, I need to add a hook ...
2
votes
1answer
2k views

passing argument to get_template_part() or a better way to code

I have this include … event-list.php <?php /** * The loop that displays upcoming events */ ?> <ul class="event-items"> <?php $yesterday = time() - 24*60*60; $args = array( ...
0
votes
2answers
118 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
529 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 ...
0
votes
2answers
293 views

Include doesn't work, getting strange path: (/usr/local/php53/lib/php) - Whats wrong? (WPAlchemy)

I´m using WPAlchemy which is a helper class for metabox creation. I´m trying to include it through my functions.php but I´m getting strange errors when I have WP_Debug set to true. For some reason ...
2
votes
2answers
741 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
989 views

Using plugin_dir_path() with WordPress on MAMP

I have the following directory structure: Root Install: /Users/philipdowner/Sites/montanaliving Within the root installation I have the following plugin structure: ...
1
vote
2answers
2k views

How can I include JavaScript that use jQuery on admin side

I try this: add_action('admin_print_scripts', 'custom_admin_scripts' ); function custom_admin_scripts() { echo '<script type="text/javascript" src="' . get_bloginfo('stylesheet_directory') ...
-2
votes
1answer
364 views

How to define category ID in an array?

I have the following: <?php if ( array( 'is_category', 'is_tag' ) ) { ?> What I want to do is (that doesn't quite work): <?php if ( array( 'is_category('13')', 'is_tag' ) ) { ?> So ...
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 ...
0
votes
2answers
398 views

include wp-blog-header not working on MAMP

To clarify my question... My plugin is/was using AJAX to call the file pluginname/submit/pick.php My pluginname/pluginname.php contains the usual plugin header and wordpress automatically finds it. ...
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
31 views

add_feed failed to open stream

Trying to add a new feed with: function events_feed() { include(TEMPLATEPATH . '/events.php/'); } add_feed('gpevent','events_feed'); And I'm getting a failed to open stream directory not found ...
0
votes
1answer
195 views

PHP files included within functions.php don't work from admin area

I've split my functions.php into multiple files using require_once, which works perfectly. However when I add admin functionality (extra panels) in one of the included files, it doesn't work? It's ...
0
votes
1answer
60 views

Include file in plugin file

I have a working plugin with many functions in it. I want to break the plugin into several file. I removed some functions and place it in a file called activate.php k7Course.php. Then in the file ...
2
votes
1answer
667 views

integrating external php library into wordpress- the right way

If I were to load a custom library into wordpress, what would be the best place to add it? Since there are a bunch of global vars defined at the top of the library, I would not want that to be done ...
6
votes
1answer
888 views

Should we use get_template_part() in functions files instead of include_once?

I'm using the theme-check plugin to check my theme for errors and recommendations, I'm using get_template_part() in theme files like header.php and index.php but in functions.php I'm using ...
0
votes
1answer
113 views

Load content From Include File within plugin

The title isn't the best, so feel free to change it to make it more clear... Problem: I am trying to load up a page from within a plugin and replace anything that WP puts out. Have it set so if they ...
0
votes
1answer
57 views

Dynamically determine URI to scripts and styles included with a class which could be added from plugin/theme/child theme/mu plugin

I'm working on a settings API class which I'd like to be able to drop into a plugin, wpmu plugin, theme, or child theme directory, and have it just work. My issue is that I'm having trouble figuring ...
0
votes
2answers
756 views

Wp Enviroment problem with included file

i have a file i am including across site to index.php, single.php etc. This file behaves really strage and acts like it not part of wordpress Enviroment meaning: i get errors on ...
0
votes
1answer
2k views

query_posts doesnt show pages with given ID when post_type => page

At the moment I am working on a WP-site, which on the frontpages has 3 excerpts of other pages on it. The code I am trying to use for this is as following: <?php query_posts(array('post_type' ...
0
votes
1answer
881 views

including Zend Gdata library path error

I'm trying to include the Zend Gdata module into a plugin, but this error appears on plugin activation: include_once(Zend\Gdata\YouTube.php) [function.include-once]: failed to open stream: No such ...
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
2answers
140 views

Using WP functions such as the_title() in an included php file

I'm including a php file in single.php, in the loop. Is it possible to use WP variables such as the_title(), the_date(), etc in the included php file?
1
vote
2answers
2k 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
1k views

How to check if txt file exists inside template folder?

I have a folder inside my theme where I hold some txt files which I am including in a theme. The problem is that before including txt file I need to check if it does exist. I fail checking it the ...
1
vote
2answers
3k views

Include a specific page in your template

How do you include specific pages into a template? Like for example on my websites main page I want to have about 3 different content areas that the client can regularly update as he needs to. I ...
0
votes
2answers
988 views

Is it possible to include an HTML flat-file website inside a WordPress theme?

Is it possible to include an entire flat-file HTML site (.html, folders/ and CSS) inside WordPress? Essentially, I want to host an HTML site, but have access to WP functions and plugins. Not to ...
1
vote
2answers
1k views

WordPress “include TEMPLATEPATH” or?

I built something like this: Index Container Widgets Area and I created a widget for that - Categories Widget - Index Container .php with this in: <?php include (TEMPLATEPATH . ...
0
votes
1answer
519 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 . ...
0
votes
1answer
258 views

What's the best way to include php code in to pages?

I'm currently creating a bunch of (empty) pages and performing conditionals such as is_page('Blabla') on it, which increases my page.php significantly. I'm already using require_once for different ...
0
votes
2answers
5k 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
2answers
1k views

Show certain terms from custom taxonomy but exclude 'parent' terms?

I have a custom post type "mycustom_products" (hierarchical) that has custom taxonomies called 'categories' and 'tags' (as many other custom post types do). My custom category is called ...
1
vote
2answers
575 views

What's the correct way to include files in Wordpress TwentyTen theme with it's own jquery scripts and css?

I want to include a slider in the default Wordpress theme on the home page. I did manage to get the page to show using <?php if ( is_home() ) { include ('slider.php'); } ?> but it doesn't look ...
0
votes
1answer
132 views

strange parse error when including a loop template within another template

I have a loop template called loop-event-details.php where I have code to display each event. My main page template is called events-page.php. I use the following code to include the loop template: ...