Tag Info

Hot answers tagged

1

Dave James Miller over at GitHub nailed this one for me. None of the work is from me, I'm just posting his code wrapped into a plguin since it works perfectly as advertised: <?php /** * Plugin Name: Set default category from url parameter * Plugin URI: https://gist.github.com/davejamesmiller/1966543 * Description: enables you to setup new post links ...


1

i think this can help you: use the below code in your theme's functions.php function redirect_homepage() { if( ! is_home() && ! is_front_page() ) return; wp_redirect( 'http://siteurl.com/news', 301 ); exit; } add_action( 'template_redirect', 'redirect_homepage' );


1

I pretty sure this filter lets you add an array of variables. I've not tested this: function add_custom_query_vars( $vars ){ $vars[] = "variable1"; $vars[] = "variable2"; $vars[] = "variable3"; //... etc return $vars; } add_filter( 'query_vars', 'add_custom_query_vars' ); Or another way of doing it would be to do this: function ...



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