• Resolved afroz327

    (@afroz327)


    How can i remove adverts fields in classified post urls

    [ redundant link removed ]

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    sorry, but i do not understand what do you mean by “remove adverts fields in classified post urls “? Can you explain your issue in a few more details?

    Thread Starter afroz327

    (@afroz327)

    Sir Just See (https://www.desiresolutions.tech/blog/advert/full-time-part-time-home-based-data-entry-jobs-home-based-typing-work/) In this url jabe “advert” after “blog” i want remove section and I have another issue that when i am clicking on a particuler category. There is no item found in single category. Please help

    Thread Starter afroz327

    (@afroz327)

    I have put also code in category [adverts_list category=”764″]. Not working this code please see

    Plugin Author Greg Winiarski

    (@gwin)

    1. you can remove the blog part (if it is a slug front, but it looks like this is just directory in which the site is installed so it will not be possible to remove it) but you cannot remove the advert part you can only change it to something else, adding the code below in your theme functions.php file will do that

    
    add_action("adverts_post_type", "customize_adverts_post_type", 10, 2);
    function customize_adverts_post_type( $args, $type = null ) {
        if( $type != "advert" ) {
            return $args;
        }
        
        if(!isset($args["rewrite"])) {
            $args["rewrite"] = array();
        }
       
        $args["rewrite"]["slug"] = "classified";
        return $args;
    }
    

    After doing this change go to wp-admin / Settings / Permalinks panel and click “Save Changes” button this will reset WP router and apply new URLs, this should also help with categories 404 pages.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘want to remove adverts in classified urls’ is closed to new replies.