viter-z-bayraku
Member
Posted 1 year ago #
If WPML and Simple custom post type archives enabled, we having redirection bug:
Single custom post type template in second language redirecting to type-yourtype.php instead of single-yourtype.php file.
For fix it in simple-custom-post-type-archives.php plugin file change:
function scpta_template_redirect()
{
if ( is_custom_post_type_archive() ) :
to:
function scpta_template_redirect()
{
if (!is_single() && is_custom_post_type_archive() ) :
viter-z-bayraku
Member
Posted 1 year ago #
This plugin too have problem with wp_title if WMPL is enabled.
For fix change this line in simple-custom-post-type-archives.php:
add_filter( 'wp_title', 'scpta_wp_title', 10, 3 );
to:
if(!is_single){
add_filter( 'wp_title', 'scpta_wp_title', 10, 3 );
}
Cole Slaw
Member
Posted 12 months ago #
Ov3rfly
Member
Posted 10 months ago #
Since I had the same problem (at first), this solution helped me but then I found on plugin authors homepage that from WordPress 3.1 the functionality of "Simple custom post type archives" is in wordpress core.
Without plugin, name your templates single-yourtype.php and archive-yourtype.php and make sure you add 'has_archive' => 'yourtype' to your custom register_post_type(..)
This page explains it in detail:
http://mark.mcwilliams.me/2010/10/wordpress-3-1-introduces-custom-post-type-archives/
So the plugin and the fix is obsolete now.