Creating a path in a plugin to call a function

Something along the lines of this would probably do it: function wpse21372_init(){ add_rewrite_rule( ‘your-page-regex/?$’, ‘index.php?wpse21372=1’, ‘top’ ); add_rewrite_tag( ‘%wpse21372%’, ‘([^&]+)’ ); } add_action( ‘wp’, ‘wpse21372_wp’ ); function wpse21372_wp( $wp ){ if( isset( $wp->query_vars[‘wpse21372’] ) && !empty( $wp->query_vars[‘wpse21372’] ) ){ //You’re on your custom page. //you may want to exit page //execution when you’re done //so … Read more

Custom Taxonomy URL

If all you wanted was ‘division’ in the URL, the trick is to register the custom post type with the slug option: ‘rewrite’ => array( ‘slug’ => ‘division’, ‘with_front’ => false ), However, since you want to substitute the current value of the division tag for the word division, the answer is much more interesting. … Read more

Rewrite-Rules not working on a vhost, everything goes to index.php

I’m not sure if this helps but its good practice, include the BEGIN and END WordPress comments around your rules as well as the check for mod_rewrite: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress Also: … Read more

Mass Permalink Changer

Maybe this doesn’t answer your question… but maybe you can adapt it to suit by changing what you put into $slug. Try this, which should loop over posts and reset the slug to match the post name. For pages, add ‘post_type’ => ‘page’ to the array passed to get_posts(). $posts = get_posts(array(‘posts_per_page’ => -1)); foreach … Read more

get the_title_attribute by id

hey just look in code and it also support fourth parameter post global $post; the_title_attribute(array(‘post’=>$post));//post object or global $post; the_title_attribute(array(‘post’=>$post->ID));//post id so you can use it like <a href=”https://wordpress.stackexchange.com/questions/111931/<?php echo get_permalink($id); ?>” title=”<?php the_title_attribute(array(‘post’=>$id)); ?>”> //where $id is post id Important Link the_title_attribute

Permalinks, Rewrites, Get Variables, Oh My!

I’m not sure but I think that you just need to add two query vars, “group” and “value”, not two rewrite tags. Can you try this: add_filter(‘query_vars’, ‘cyb_add_query_vars’); function cyb_add_query_vars( $vars) { $vars[] = “group”; // name of the var as seen in the query string and URL $vars[] = “value”; return $vars; } add_action(‘init’,’cyb_add_rewrite_rules’); … Read more

Custom url for a single page

Read on htaccess. You can try this, <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^phones$ /?page_id=1081 [L] </IfModule>