0
votes
0answers
28 views

$post->ID not working but the get_the_id() is [duplicate]

I created a custom post type from a Plugin. Then in a function like show_data() I queried the post type along with its post meta data (Custom Fields). Then in Page Template I used the function to show ...
1
vote
1answer
39 views

Custom Plugin theme filter

I am creating custom plugin and in my plugin file I have this: add_filter('page_template', 'load_tq_templates'); function load_tq_templates() { if (is_page( 'transport-quote-1' )) { if ( ...
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 ...
-1
votes
1answer
256 views

How to create a page template using custom plugin

I am building a plugin. I just want to create page template whenever i install plugin. Page template like full-width template. I have used codes after searching but not able to get success. So please ...
0
votes
1answer
275 views

How to use a dedicated template for the Custom Post Type from a plugin?

I'm working through this tutorial on Custom Post Types (in a plugin) wherein the author demonstrates how to force the use of a dedicated template for the Custom Post Type. The author states thus: ...
0
votes
2answers
330 views

Load page template with custom content using a plugin

I want to load the page.php template with the content I specify (using variables and not from the database) if the request contains a particular query string. So lets say a user requests ...
0
votes
1answer
61 views

How to remove/replace current page template?

I am writing a plug-in that creates new front/home page from scratch. Below code works nice and it outputs the text before the themes outputs anything. So the question is how can I remove the theme ...
0
votes
1answer
608 views

How to create custom home page via plugin?

I want to code a plug-in that creates new custom home page. Note that I have never coded any plug-in before. 1) After activation of plug-in user needs to go to the options of the plug-in and set up ...
0
votes
1answer
346 views

Build dynamic page from cURL (HTML page) response with plugin

I feel like I am missing something simple here, but can't figure it out I need to have my plugin build links to a page that is built entirely via a cURL response. I am building a plugin that ...
0
votes
1answer
232 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"> ...
1
vote
2answers
114 views

How to display non-page / post content

I have a custom made Twitter stream on my site. I want to have a permalink for each tweet which would go to a page which would display only the tweet - no other content - surrounded by my custom ...
1
vote
2answers
250 views

Using custom page templates with plugin [duplicate]

I'm developing a plugin. This plugin creating a new post type and displaying these posts in a custom template. For example it's a event calendar plugin. This plugin creating a new post type 'event '. ...
9
votes
5answers
2k views

How can I add an option to the Page Template list from a Plugin?

I've been looking around for the past couple hours for a way to create a custom page template from within a plugin but haven't had any luck yet. What I am specifically trying to do is add an option ...
0
votes
1answer
248 views

How do I create a custom post type for a training CMS in WordPress?

I need to create a custom post type based on the existing 'Page' type, for a WordPress based training CMS. I have no problem simply creating a new post type, but I would like to offer some kind of ...
0
votes
1answer
60 views

my basic php code producing unexpected results

I am writing a code snippet to display attachments to a post but for each user, he should only be able to see his own attachments and not those of other users $current_user=wp_get_current_user(); ...
0
votes
1answer
1k views

Change template dynamically

Is it possible to change the template loaded for a page, as it loads, without having to change the record in the database? I suspect it can be done with the template_redirect action, and the will ...
1
vote
1answer
721 views

Is it possible for a plugin to register a page template file?

Is there a way for a plugin to house page template files and have them available after plugin activation? E.g, I have a plugin that requires specific page page templates to be used, so I'd like ...