filtering special chars from post slug
Found the answer I was looking for: <?php // Cleans special characters out of the slug, if the slug hasn’t been set yet add_filter(‘name_save_pre’, ‘clean_slugs’, 0); ?>
Found the answer I was looking for: <?php // Cleans special characters out of the slug, if the slug hasn’t been set yet add_filter(‘name_save_pre’, ‘clean_slugs’, 0); ?>
The styles are not created in CSS, they are created in page markup. If your theme and template are coded properly they make use of body_class() function, that will output number of classes for you to make use of in page source. View source of your page and <body> tag to see what you have … Read more
No, it is not entirely possible. WordPress is using Percent encoding to sanitise the slug. You could undo this, and it would deliver nonlatin characters, but the browser would immediately swap these out for percent encoded characters when you tried to visit the page. Wether your database will store these characters, and the table encoding … Read more
This is not possible out of the box, nor is it advisable, and for good reason. If you really did want to do this you would need to hack the core files. Why it’s not a good idea: WordPress does not check for Permalink clashes between taxonomy term slugs and page slugs Say you have … Read more
I got fix this problem with: add_rewrite_rule(‘blog/([^/]*)/page/([0-9]+)?/?$’, ‘index.php?post_type=blog&blogs_tax=$matches[1]&paged=$matches[2]’, ‘top’); In functions.php, after register_post_type. Very important: You must flush rules. It is easy to do changing the permalink.
Why don”t you use get_page_by_title() to get the page object, and then pass its ID as the child_of parameter? If you would rather use the actual slug, then get_page_by_path( $slug ) should do the trick. So: if ( $page = get_page_by_path( ‘your-page-slug’ ) ){ wp_list_pages( ‘orderby=name&depth=1&order=DESC&show_count=0&child_of=” .$page->ID . “&title_li=’ ); }
Make the slug translatable when you register the custom post type: register_post_type( ‘post_type_name’, array ( ‘rewrite’ => array ( ‘slug’ => _x( ‘post_type_name’, ‘URL slug’, ‘your_text_domain’ ) ) ) ); Then create a small plugin for the site where you want to change the slug: add_filter( ‘gettext_with_context’, ‘change_my_slug’, 10, 4 ); function change_my_slug( $translation, $text, … Read more
Simple answer is that you can’t as far as the default wordpress installation goes. It’s a must to have unique slugs. You can however mess with the Rewrite API with some custom code to hack your way around this & there aren’t any plugins(AFAIK) to help you on your way. So it’s definitely a lot … Read more
The permalinks by default are output relative to the site’s blog posts index (aka ‘page-for-posts’, aka posts page). You’re using a custom page template for the static page Section/News. That static page is unrelated to the site blog posts index. That’s why the permalinks don’t reference that page. If you want your permalinks to reference … Read more
This is about a year over due. I have had a similar thing happen on my new word press install. Creating pages dynamically and getting incremental numbers on the slug names. During this process I realised that the original slug would access the last one. ie. ../../dynammic-page would access ../../dynamic-page-4 The solution was in the … Read more