WordPress.org

Ready to get started?Download WordPress

Forums

Simple Custom Post Type Archives
WPML single template fix (4 posts)

  1. viter-z-bayraku
    Member
    Posted 3 years 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() ) :
  2. viter-z-bayraku
    Member
    Posted 3 years 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 );
    }
  3. Cole Slaw
    Member
    Posted 3 years ago #

    Thanks!

  4. Ov3rfly
    Member
    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic