Tag Info

New answers tagged

0

Can you provide a link to your site and a little more explanation on what you are trying to achieve? Here's a shot in the dark guess. Archives shows content of type 'post', but you can alter it to include custom post types. Add this filter to your functions.php file: function namespace_add_custom_types( $query ) { if( is_category() || is_tag() && ...


1

Looks like your canonical URL is set to http://www.ideabroad.com/question/. I suspect your Yoast SEO plugin is doing this. You need to reconfigure it appropriately.


0

Found a box under Screen Options to display the Slug on the custom post type. Created a metabox with the slug to be edited, not quite how it works on Pages but it solved the issue.


0

Readadd_menu_page carefully: $menu_slug (string) (required) The slug name to refer to this menu by (should be unique for this menu). Prior to Version 3.0 this was called the file (or handle) parameter. If the function parameter is omitted, the menu_slug should be the PHP file that handles the display of the menu page content. Default: None


0

Here's an example how you can auto generate numeric slugs, other than the post IDs: /** * Auto generate numeric slugs for a given custom post type (via post.php screen) * Requires PHP 5.3+ * @see http://wordpress.stackexchange.com/a/169907/26350 */ add_action( 'load-post.php', function(){ add_filter( 'wp_insert_post_data', function( $data, $postarr ...


0

function wpse_18293_get_random_string ($number_of_chars_to_use) { $upper_case_charachters = range('A', 'Z'); while($cnt < $number_of_chars_to_use) { $random_string.= $upper_case_charachters[mt_rand(0, count($upper_case_charachters)-1)]; $cnt++; } return $random_string } $random_string = ...



Top 50 recent answers are included