This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by Robert 4 years, 9 months ago.

Assigned support staff: Robert.

Author Posts
January 8, 2015 at 8:02 pm #539536

Timothy

I am trying to: I have already setup a custom slug on one of my previous custom post and it worked. However, when trying to setup this new slug for custom post it did not work. I have searched on Google for solutions and suggested and I am sure it related to the coding.

I visited this URL:

It is the Traditional Chinese Link:
hidden link
Simplified Works:
hidden link
English Works:
hidden link

My functions.php for declaring the the custom post. listings work but not requestlistings.

// Create Listings Section
add_action( 'init', 'create_post_type' );
function create_post_type() {
  register_post_type( 'listings',
    array(
      'labels' => array(
        'name' => __( 'Listings' ),
        'singular_name' => __( 'Listing' )
      ),
    'public' => true,
    'has_archive' => true,
	'rewrite' => array('slug' => 'listing'),
    )
  );
  register_post_type( 'requestlistings',
    array(
      'labels' => array(
        'name' => __( 'Request Listings' ),
        'singular_name' => __( 'Request Listing' )
      ),
    'public' => true,
    'has_archive' => true,
	'rewrite' => array('slug' => 'requestlisting')
    )
  );
}

I expected to see:

Instead, I got:
I got a redirect loop.

**edit**
Could you send me an email so I can send you the domain url as I want to keep it private and not searchable through search engine.

January 9, 2015 at 10:17 am #539797

Timothy

If you need access information and could check previous history you can check from this previous case. Thanks.

https://wpml.org/forums/topic/make-duplicates-of-a-post-does-not-work/

January 9, 2015 at 11:18 am #539845

Robert

I did a local test of your registration and everything seems to be in order... After translating those slugs via WPML > Translation Management > Custom Post > did you also re-save your Permalinks? This may be needed to refresh those changes across the site. Simply visit Settings > Permalinks > Save

I can enable private fields for your response for further information which is only visible to me, please look for this field below.

January 9, 2015 at 4:11 pm #540094

Robert

Unfortunately support is only available M-F, I will return to this issue first thing Monday. Thanks for your patience.

January 12, 2015 at 10:39 am #540859

Robert

Upon logging into the site, when trying to visit the front end, I am asked to enter password again. The one provided doesn't get me past this page. Can you please resolve that issue so I can take a close look at the site?

January 12, 2015 at 11:53 am #540920

Timothy

Hi Robert,

Thanks for your help, the public login is robert and the password is 96847090. I will change the access when you have complete and this will not have any CMS access so don't have to worry about the privacy. Thanks.

January 12, 2015 at 4:14 pm #541197

Robert

Just to let you know, I am still looking into the issue. Please hold on for more information.

January 12, 2015 at 4:49 pm #541228

Timothy

Hi Robert,

Thanks for your update. Just a heads up the custom post for 'listings' is not working now too, I understand you are working on something and just wanted to give you a heads up. Thanks.

January 13, 2015 at 12:05 pm #541643

Robert

I went through and re-saved your settings a few times (deleted strings - re-translated, re-saved permalinks) and I have the same result on upon viewing the individual request listing in the default language.

I do notice that the archive does work properly /%E6%90%B5%E7%A7%9F%E5%91%8A%E7%A4%BA/ - This leads me to believe that it may be the markup to output this CPT rather than the registration of the slug. Can you please try switching to a default theme and recreating the CPT to check if the issue persists?

The topic ‘[Closed] Custom Post Type's string slug not working.’ is closed to new replies.