I want to preselect a custom template based on the URL. For example, if I open the URL “https://www.suncadiacabinrental.com/wp-admin/post-new.php?tmpl=MyCustomTemplate” I want the template “MyCustomTemplate” is preselected instead of “Default template”. Is there a way to do that adding a function to functions.php?
Thanks!!
]]>I have always used this plugin and I have never had problems unfortunately but it does not work with child-themes how can I solve? Thank you!
]]>Plugin “Custom Post Templates” 1.5 appears to be abandoned (updated 14th June 2012, tested to WP 3.4.2)
Is this plugin still being supported? If not, are there any alternative solutions?
]]>Hello,
I have several custom post types and I managed to work ok with your plugin – all custom post types have a field to select specific tempplate I made.
Now I have this situation:
– one of my custom post types (with many posts published) let’s name it “cptnm1”
needs a custom post template change
– all of them already have selected for example “cpt-template-1”
– it would be long if I have to click and edit all of them one by one to select different custom post template “cpt-template-2”
Is there a way I can run some function through database tables in phpMyAdmin to select all posts which are custom post type “cptnm1” and change their custom post type template?
Something like:
UPDATE wp_posts
SET custom_post_template
= ‘cpt-template-2.php’ WHERE post_type
= ‘cptnm1’;
I have just a little bit of experience with database and phpMyAdmin, not enough to be sure what to do exactly.
I will make a backup of course – just wanted to check with you if this is possible and to check what is the right sintax for phpMayAdmin to make this change.
Thank you,
S
My hosting has upgraded PHP to 7, and I’ve been getting a lot of the following message in my logs:
Methods with the same name as their class will not be constructors in a future version of PHP; Widget_SU has a deprecated constructor in /var/www/vhosts/hikari-images.co.uk/drewk.photo/gallery/wp-content/plugins/custom-post-template/plugin.php on line 507
Changing the line :
function Widget_SU ($name, $max = 1, $id = '', $args = '')
to
__construct ($name, $max = 1, $id = '', $args = '')
seems to sort the problem
is this plugin needed any longer now that wp offers custom post tempaltes: https://premium.wpmudev.org/blog/post-type-templates/
thanks,
jeff
]]>I’m receiving this error message in the post edition page, where is suppose to appear the select html for choosing the template for the post.
Rendering of admin template /home/elevando/public_html/wp-content/plugins/custom-post-template/view/admin/select_post_template.php failed
It start appearing this error with the update of the wp version.
]]>I have deleted a custom post template from my theme directory, and yet I’m still seeing it in the dropdown for selecting the template in the post edit page. Is there something else I need to do besides delete the template to remove it from the site?
]]>Hi,
I am quite new to WP,, using a theme that doesn’t have custom post templates. I want however to be able to have single image posts, so I downloaded the plugin “Custom Post Template” Version: 1.5, Author: Simon Wheatley.
I used all default settings (recommended) since I don’t know how to change anything…
The photo posts worked as you can see here: https://travelways.com/My-Photos/, but the tags don’t. For example if I click on “peggys-cove” tag, I get the content post I made, but not the photo posts
I need to have some help with this please.
PS: As instructed, I added at the top of each photo post this script:
—–
<?php
/*
Template Name Posts: Photo post
*/
?>
—-
I have no idea if in my case this is correct or not, but without it it doesn’t work.
Please help.
Thanks,
Tatiana
]]>Hi, I have a question. I need so that users do not have to enter so many steps, so I thought still works automatically assign a template to a category.
When users click on your category, and will be automatically assigns the template.
Hello,
Will you be updating this plugin to be compatible with WordPress 4.2.2?
]]>Would love to see that as Im in need of one right now.
]]>Does this plugin support custom post types ?
]]>Hey, I have been trying to get a custom post template added as an exception in the template-tags.php file of the WP 2014 theme. The code looks like this:
function twentyfourteen_post_thumbnail() {
if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) {
return;
}
if ( is_singular() ) :
?>
<div class="post-thumbnail">
<?php
if ( ( ! is_active_sidebar( 'sidebar-2' ) || is_page_template( 'page-templates/full-width.php' ) || is_post_template( 'single-presentation.php' ) ) ) {
the_post_thumbnail( 'twentyfourteen-full-width' );
} else {
the_post_thumbnail();
}
?>
The issue is, the post template is not registering as an exception to the thumbnail rule. This means all posts under the template are by default 2014 thumbnails and not full width. Any help would be really appreciated.
Cheers.
]]>Please add the choice of template pages tags!
]]>Hello Simon,
Custom Post Templates is an incredibly helpful plugin. However, I’ve started to notice PHP Notices for new/unsaved posts when using the plugin with debug enabled. The notice is:
NOTICE: wp-content/plugins/custom-post-template/custom-post-templates.php:112 - Undefined index: custom_post_template_present
This was easy to fix by checking to see if the custom_post_template_present
POST variable is set before continuing. I just added the following right above line 112:
if( ! isset( $_POST[ 'custom_post_template_present' ] ) ) return;
Any chance you could incorporate this into a future update to the plugin?
Thank you!
]]>Disclosure: I am a WP newbie
site: https://www.ccrt.net/
I installed this plugin a while ago and created a template that i named no_sidebar. I now want to edit the contents of that template but I can’t find it. Can you tell me how to get back to it?
Best regards,
Kathie
Hi all
I want to create a simple post template for use in a custom post type acrss my site. All I want is a border around the
content. How do I go about creating this?
My thx.
]]>Just curious if this plugin is being abandoned or of there is an update in the works. It is great, but I don’t want to get caught unprepared with a compatibility/security issue down the road.
Thanks.
]]>Hi,
I have tried using get_template_part in a post template and not getting a result. Can anyone confirm if this template tag is incompatible with this plugin?
Thanks in advance,
J
]]>I use the code bellow to load a stylesheet only if is a template page. How to do it with the plugin?
<?php if ( is_page_template('schools.php') ) { ?>
<link rel="stylesheet" href="<?php echo get_stylesheet_directory_uri() ?>/schools.css" />
<?php } ?>
]]>
Hi,
If I change the theme – all the posts forget which template they are using and revert to default.
I still have the same custom templates in my new theme.
How can rectify this quickly?
THanks
]]>Hmm, this has been asked but the instructions are confusing.
1) Install Plugin – OK
Upload custom-post-template directory to your WordPress Plugin directory –OK!
Go to the plugin management page and enable the plugin –OK!
Upload your post template files (see the Description for details on configuring these), and choose them through the new menu ??
So as a test i created a blank file called snarfer.php
<?php
/*
Template Name Posts: Snarfer
*/
?>
Uploaded that file to my theme directory (where else?)
The post editor shows: This theme has no available custom post templates.
Expected result: Dropdown option with snarfer.php
So what′s the secret?
]]>Has anyone had any success applying Advanced Custom Fields to a Custom Post Template.
The only option seems to be to apply them to a Page Template.
I need to be able to apply custom fields to a certain Custom post type but not all of them.
Cheers
]]>Hey, I’m new to writing php, but I uploaded single-fullwidth.php, selected the Full Width template, but it returns a blank page.
The code I’m using for the full width template is:
<?php
/*
Template Name Posts: Full Width
*
/?>
get_header(); ?>
the_content();
<?php if ( have_posts() ) : while( have_posts() ) : the_post();
the_content();
endwhile; endif; ?>
<?php do_action( 'cyberchimps_before_container'); ?>
<?php do_action( 'cyberchimps_page_content' ); ?>
<?php do_action( 'cyberchimps_after_container'); ?>
<?php get_footer(); ?>
Appreciate any and all ideas you have for fixing this
]]>Dear Friends..
I want use custom post template and i install this plugin but how to set and how to use it’s plugin i don’t know so please provide me anyone how to use custom post template plugin
]]>Hello,
I am using https://www.easyreviewtheme.com/ theme
And want to show all my post as full with (no sidebar) only post and pages not home page.
I installed this plugin and try to locate file but can not.
Can anyone let me know exactly where to change code?
Fatal error: Call to undefined function wp_get_theme() in /home/odevikap/public_html/wp-content/plugins/custom-post-template/custom-post-templates.php on line 164
in widget
]]>I would like to modify single-recipes.php so that my post does not have any date, admin, comments, edit labels. I want a clean post for my static page.
Thank you,
Mike
Is it possible to set a default template for posts to use?
]]>