The tag has no usage guidance.

learn more… | top users | synonyms

0
votes
3answers
24 views

php include returns 1 after content

I'm using a customized wordpress loop which allows me to style the post a certain way after a certain amount of post. For example, The first three post will be styled the same, the next 4 post will ...
0
votes
1answer
18 views

require happens out of order

I have a page template that is including another file via require_once. I want this included file to have access to the $post object but it can't find it. So I ran something like this to see what's ...
0
votes
1answer
94 views

wp_mail: Using file_get_contents to include template in message

I want to use a template as the message in an email which I send with wp_mail. But I get the error: "failed to open stream: No such file or directory". add_filter( 'wp_mail_content_type', '...
1
vote
1answer
107 views

WordPress rewrite rules for state and city

I'm building a site where every state and city in the US has a landing page. I have a database of every city, state, and zip code, set up as a custom post type in WP. Here's what I've done ...
1
vote
3answers
126 views

Get template name by full URL

Is There Any Way to get the template Name By full URL for example If the full url is www.example.com/hello-world I need a function that return the template name (page.php) I know that WordPress ...
2
votes
1answer
132 views

Custom Endpoint Gives 404 Header

I'm trying to write a general endpoint that loads a template. It works as expected with the small exception that the returned header is 404 - Page not Found. Am I missing something in my rewrites? ...
0
votes
0answers
28 views

Rewrite / Template Include Filter, assumes front-page?

I'm pulling in data from a 3rd party API for a project I am working on. I've filtered template_include to pull a template query var, which I pass through various add_rewrite_rules. My problem is ...
0
votes
0answers
247 views

Using require_once for parent-directory not working but is working in sub-directories

I'm building a custom theme and I'm attempting to use require_once __DIR__ . '/templates/variables.php' in my footer.php file, to keep from repeating code that contains variable information... I keep ...
3
votes
2answers
404 views

template_include for search.php makes Wordpress think its on the home page

I have a custom tag-search feature, which allows people to search multiple tags to return relevant posts. Say they want to see posts that are tagged both 'Wordpress' and 'Tutorials'. I'm using the ...
0
votes
2answers
120 views

unexpected T_FUNCTION in plugin template [closed]

I have a plugin I have developed for a client which works fun on my server but doesn't work on theirs, they are on godaddy so I am guessing it's an issue with their PHP version? add_filter('...
0
votes
1answer
69 views

Template Include crashing browser

I am creating a plugin which requires use of custom templates so using the following code to use the templates: add_filter('template_include', 'hhavideo_set_template'); function ...
2
votes
1answer
164 views

template_include not loading -instead goes to index.php

I have the following code: <?php function ex_rewrite_rules(){ //discography query variable rewrite add_rewrite_rule( 'artists/([^/]+)/discography/?$', 'index.php?album_artist=$matches[1]&...
0
votes
1answer
54 views

Theme parts path location dump

Few months back I was working on customizing theme that I was assigned to. I remember that I used some function or define something in the config or theme functions file and than it displayed debug ...
1
vote
1answer
38 views

problem including page template

I am creating a one page wordpress site. The code I am using does work but for some reason it will not include page templates. It only gets the content from the page editor but will not get the custom ...
1
vote
0answers
42 views

A include_template Question

Right now I am building virtual pages on a wordpress install. I use the include_template hook to add some logic that checks for a 404 page & some regex to look for a specific pattern. This seems ...
0
votes
4answers
613 views

Link to file in plugin directory from wordpress template?

I know that plugins and theme files should be kept separate but for for internal use I need to do it this way. In my themes header.php file I want to include a php file which just contains html, ...
1
vote
1answer
281 views

template_include filter does not render the custom template

I created a plugin that will render a shortcode that is entered to a page. This Shortcode shall override the theme's page template and use the one that I included on the plugin Here's my code: api....
0
votes
0answers
24 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 ...
13
votes
3answers
5k 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 ...
0
votes
0answers
76 views

Add new template file in plugin [duplicate]

Possible Duplicate: Create custom page templates with plugins? I create a plugin and a template file but I do not know how to include the template file in the plugin For the moment, I use the ...
8
votes
2answers
4k views

Use template_include with custom post types

I want to check for an appropriate template in the theme folder before falling back to the file in my plugin directory. Here’s my code: add_filter('template_include', 'sermon_template_include'); ...
0
votes
1answer
2k 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 ...
15
votes
3answers
853 views

Methods of Integrating Plugin Data with Themes

I would like to get some opinions regarding the best practices for developing WordPress plugins that provide theme integration. In order to make sense as I ask this question, let me start with an ...