0
votes
0answers
33 views

Perform internal redirect in WordPress?

Let say I have an existing page named "bar", e.g. http://www.example.com/bar I want to write a plugin, which when called, will load the content exactly same as bar (not just post_content, but the ...
0
votes
0answers
21 views

What is the best way to store HTML fragment in WordPress?

Let say I want to store an HTML fragment in WordPress and allow user to update/modify, e.g. site wise notice, what is the best way to store it and present them in a theme? e.g. write a plugin to ...
0
votes
1answer
25 views

Making plugin output customizable

I am writing a plugin that will display a timeline of historic events, and I am looking for ways to make the output customizable. I was considering including a template/example within the plugin ...
1
vote
0answers
42 views

Plugin templates vs Parent Theme

I've been building a plugin using a WooCommerce like template system, where the plugin houses the default templates, but allows for overriding via a template folder in your active theme. It just ...
1
vote
2answers
164 views

Filter to change the content of 404 page

I have created custom rewrite rules. These rules now go to 404 page as expected. I can use action hook template_redirect to change the template matching query_var. But I don't want to create separate ...
0
votes
1answer
22 views

How do I show content from a plugin using the template the site is currently working with?

I am trying to extend the first serious plugin that I am building. I'd like to be able to use it with different sites/templates. At the moment I designed a custom page that I included with the ...
3
votes
2answers
100 views

When is it appropriate to put functions on page template vs. functions.php?

I'd like to improve my code and on a current theme, I've extended Wordpress with custom post types, metadata, customized user authentication, and a number of other items. Some of these functions ...
0
votes
1answer
61 views

Use different archive template for plugin

In my blog, I'm using a plugin for an encyclopedia. Unfortunately, the plugin uses the archive template from my blog. How can I use a different page / template for the encyclopedia? Here is the ...
0
votes
1answer
168 views

How to display custom taxonomy and terms using/creating plugin template

I am working on a plugin which requires a custom taxonomy and 3 terms (Personal, Group & Pets). I already have the taxonomy set up with terms and some sample posts. I've created a template for my ...
0
votes
0answers
66 views

Most elegant way to create html for shortcodes?

Shortcodes seems to be very nice way to introduce complex features to the content blocks, but I don't like to generate html inside shortcode function. Instead I would like to create template file for ...
0
votes
0answers
343 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 ...
1
vote
1answer
121 views

Where to call wp_enqueue_script in a plugin with custom template?

I am writing my first plugin and I have this code in the main plugin php to replace home page with custom template add_filter( 'template_include', 'replace_home_page' ); function replace_home_page( ...
0
votes
1answer
87 views

How to check during “pre_get_posts” if WP performing default query for specific custom template?

I want to modify default query for custom RSS template loaded by plugin that i'am writing right now. What is the best way to check - in function hooked to "pre_get_posts" - if default query for my ...
2
votes
1answer
227 views

Get image URL from media library in input

On wp-admin/post.php?post=447&action=edit for example I have a link and an input. The link appears as follows: <a href="#" class="button insert-media add_media" data-editor="tj_image_url" ...
0
votes
1answer
166 views

Wordpress removing data attributes for scheduled post

Hi I'm using the smarty templating engine in wordpress to generate HTML like the one below: <li> <div class="checkbox_container" data-asin="B0009Y7APU"><input type="checkbox" ...
3
votes
2answers
2k views

Pass PHP variable to javascript

Is there any possibility to pass some PHP variables in javascript so I can use them later? Only in single.php. I heard about wp_enqueue_scripts but with that it is neccesary to declare a path to a JS ...
0
votes
1answer
249 views

Load php file with jquery in single.php

I implemented in my worpdress theme ios button switch and when someone click the button the script load a php file with the text: on or off Here is the code: <script type="text/javascript"> ...
4
votes
3answers
493 views

How to control output of custom post type without modifying theme?

I have a custom post type 'properties' that I'd like to control the HTML output for. For simplicity, let's focus on the archive view. As a basic example, here is what a loop looks like in an ...
7
votes
2answers
1k views

Looking for WordPress System Diagrams

I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. source: ...
2
votes
1answer
568 views

How to set a fall back template for a custom post type in a plugin?

My custom plugin creates a custom post type, and I want to theme my own "single-my_custom_cpt.php" file. However, I want to store it in my plugin folder, and allow that it be over-written in the ...
0
votes
1answer
354 views

Default taxonomy template in plugin, override in theme

Building off of this question/answer, I've sucessfully implemented the single view for my custom post types, but I'd also like to offer the same thing for taxonomies. I've looked through the docs and ...
1
vote
1answer
2k views

Getting template_include to work when allow_url_include is off?

I'm working on a plugin that creates a custom post type and I would like to display a custom template without modifying the theme. Here's the simplified code I'm working with: ...
0
votes
3answers
601 views

What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?

So the reason why I am don't want to include get_header() or get_footer() tags is because this page will be loaded as an iframe using the thickbox modal plugin and its content will be a form and I ...
4
votes
3answers
2k views

Creating a default Custom Post Template that a Theme can override

I'm in the midst of building a Wordpress Plugin that adds a custom post type, for which I'd like to include a default template to display. Essentially, this is an event management plugin, and the ...