Support » Plugin: WPCasa » Snippet: Custom Listing Post Type Slug

  • Resolved kinkmobile



    I’m trying to use this snippets to change the ‘listing’ post type :

     * Custom Listing Post Type Slug
    add_filter( 'wpsight_rewrite_listings_slug', 'custom_rewrite_listings_slug', 11 );
    function custom_rewrite_listings_slug( $slug ) {
    	return 'mycustomtype';

    It works for both new listing i added and the links in the front end are also changed in what i want… But all links bring to 404..

    Permalinks seems Ok in both old and new listing i’ve made..

    I directly tried to edit the file “class-wpsight-post-types.php”, and changed directly the line 287 :
    'rewrite' => array( 'slug' => apply_filters( 'wpsight_rewrite_listings_slug', 'mycustomtype' ), 'with_front' => false ),

    But.. It leads to the same result : 404 !

    Help appreciated, i really need to change the post type..

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WPSight



    as already written in another thread I guess this must be solved now.

    The issue was basically that the permalinks hasn’t been re-saved after the code snippet has been added. This is an important step to get the htaccess file regenerated/adapted in order that the new URLs doesn’t redirect to a 404.

    Let me know if anything remains unclear.

    All the best

    Thread Starter kinkmobile


    It was this ^^ TY it works, i just had to re-save 2 times the permalinks, but i guess it’s due to a lag of my test server.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Snippet: Custom Listing Post Type Slug’ is closed to new replies.