Tag Info

Hot answers tagged


I tried to figure this out not long ago and the short answer from what I know is no. Not from within the rewrite argument at least. The long explanation becomes apparent if you look at the actual code of register_post_type in wp-includes/post.php line 1454: add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $permastruct_args ); You ...


The following code will work, but you just have to keep in mind that conflicts can happen easily if the slug for your custom post type is the same as a page or post's slug... First, we will remove the slug from the permalink: function na_remove_slug( $post_link, $post, $leavename ) { if ( 'events' != $post->post_type || 'publish' != ...


In response to my previous answer: you could of course set the rewrite parameter to false when registering a new post type and handle the rewrite rules yourself like so <?php function wpsx203951_custom_init() { $post_type = 'event'; $args = (object) array( 'public' => true, 'label' => 'Events', 'rewrite' ...


You need to tell get_edit_post_link to not use the ampersands as specified in the codex. Try this instead: var pop = window.open(' <?php echo get_edit_post_link(get_the_ID(), ''); ?> ', '_blank', 'screenX=200,screenY=200,width=1000,height=600');

Only top voted, non community-wiki answers of a minimum length are eligible