WordPress.org

Ready to get started?Download WordPress

Forums

Polylang
Remove category from url (2 posts)

  1. camit
    Member
    Posted 1 year ago #

    I use polylang on my site. Url is something like the following form: http://site.com/category/news for english and http://site.com/ru/category/localized_name for other languages. It's work fine.
    I want to remove 'category' form url. I downloaded and installed WP No Category Bass plugin. Its work fine on base language, but on other laguages no select posts by category. I see all post for selected language. Help please.

    Small fixes for your code:

    // meta in the html head section
    	function wp_head() {
    		// outputs references to translated pages (if exists) in the html head section
    		foreach ($this->get_languages_list() as $language) {
    			if ($language->slug != $this->curlang->slug && $url = $this->get_translation_url($language))
                                //!Ad >> $url may be error object
                                if (is_string($url))
                                // << !Ad
    				printf("<link hreflang='%s' href='%s' rel='alternate' />\n", esc_attr($language->slug), esc_url($url));
    		}
    	}

    http://wordpress.org/extend/plugins/polylang/

  2. camit
    Member
    Posted 1 year ago #

    Thank you for your answers.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic