Support » Plugin: Simple Custom Post Type Archives » [Plugin: Simple Custom Post Type Archives] WPML single template fix

  • viter-z-bayraku

    (@viter-z-bayraku)


    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() ) :
Viewing 3 replies - 1 through 3 (of 3 total)
  • 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 );
    }

    Thanks!

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Simple Custom Post Type Archives] WPML single template fix’ is closed to new replies.