changing permalink for custom template in posts of a certain category

You can achieve this via the Rewrite API‘s add_rewrite_endpoint: function wpa89344_add_presentation_endpoint(){ add_rewrite_endpoint( ‘presentation’, EP_PERMALINK ); } add_action(‘init’, ‘wpa89344_add_presentation_endpoint’); Then in your template or wherever you differentiate a presentation vs normal view, check the global $wp_query for the presence of the presentation query var: global $wp_query; if( isset( $wp_query->query_vars[‘presentation’] ) ){ include(TEMPLATEPATH . “/single_wide_report.php”); } else … Read more

issue with setting up permalink programmatically

Try to do something like this. <?php /* Plugin Name: My Custom Plugin Plugin URI: Description: Author: Version: 1.0 Author URI: */ /* Runs when plugin is activated */ register_activation_hook(__FILE__, ‘mcp_install’); /* Runs on plugin deactivation*/ register_deactivation_hook( __FILE__, ‘mcp_remove’ ); function mcp_install() { //Make sure that .htaccess file is there. add_action(‘init’, ‘change_permalinks’, 20); //Activate your … Read more

Changing the post date without causing 404 error

You’ll need to add 301 redirects for the old URL to the new one. Your best bet is to do this via .htaccess, in your theme, or using a plugin like one of these: http://wordpress.org/plugins/simple-301-redirects/ http://wordpress.org/plugins/safe-redirect-manager/ Edit: Another option OPtion 2 would be to disregard the date in the URI altogether. You could unset them … Read more

Pages not using permalink

If you’re getting Index of /blog Apache Server Port 80 instead of a 404 page, you might be having a folder called blog in on your server. Try deleting or renaming that folder if you’re not using it. EDIT: Here is a related question: WP Page and Subdirectory with same name

Custom WordPress user permalink

the problem with this question, and of a lot of questions like this, is the one pinted out by @Milo in comments: if you write a rewrite rule to handle you custom url, this goes in conflict with WordPress rules, e.g. if your urls are htt://example.com/username/city/occupation how WordPress can know if you are actually lookin … Read more

Using WP Rewrite, but just not “getting it”

Your rewrite setting is good, but WordPress are redirect to the canonical url of the post. This is done by WodPress to prevent bad indexing for duplicate content (when an identical content is accessible via 2 different urls). You can prevent that removing the canonical redirect filter: add_action(‘wp_loaded’, function() { remove_filter(‘template_redirect’, ‘redirect_canonical’); }); However this … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)