Search the Community
Showing results for tags 'url rename'.
-
Hi. I would like that when some people will enter to website see short url like this GRIMLORD.EU/START now I have this http://www.grimlord.eu/index_pl.php?src=home. pls help me
-
Hi All, I'm trying to rename a category name from my url. Here it is: // Register custom post types add_action('init', 'pyre_init'); function pyre_init() { global $data; register_post_type( 'avada_portfolio', array( 'labels' => array( 'name' => 'Portfolio', 'singular_name' => 'Portfolio' ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => $data['portfolio_slug']), 'supports' => array('title', 'editor', 'thumbnail','comments'), 'can_export' => true, ) ); register_taxonomy('portfolio_category', 'avada_portfolio', array('hierarchical' => true, 'label' => 'Categories', 'query_var' => true, 'rewrite' => true)); register_taxonomy('portfolio_skills', 'avada_portfolio', array('hierarchical' => true, 'label' => 'Skills', 'query_var' => true, 'rewrite' => true)); ... Here is what I have at the moment: function custom_portfolio_to_customer_category_url($content) { $current_path = 'portfolio_category'; $new_path = 'customer_category'; $content = str_replace($current_path, $new_path, $content); return $content; } add_filter('term_link', 'custom_portfolio_to_customer_category_url'); I'm using the str_replace() function to rename portfolio_category to customer_category. "It" did replace it but it seems to have wiped out the category and I'm unable to access the portfolio_category post. Can someone please guide me or assist me in what I'm doing wrong here? Thank you, Hal
-
- wordpress
- str_replace
-
(and 2 more)
Tagged with: