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

resetting permalinks after changing page names

Not 100% what you mean. Apologies if this is obvious but… if just want to change the parent page title, and have that reflected in all the link structures you’d change the permalink for the page, just underneath the page title. Or is it something different?

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

Get term name and term parent into custom post type permalink

I solved this issue by the following codes where you need to define “rewrite” argument as follows register_taxonomy( ‘map_categories’, ‘map’, array( ‘hierarchical’ => true, ‘label’ => ‘Catégories’, ‘query_var’ => true, ‘rewrite’ => array(‘slug’=>’commerce/artisans’,’with_front’=>false, ‘hierarchical’ => true) ) ); You need to understand that ‘hierarchical’ in rewrite actually solve your purpose. After the update in codes … Read more

WordPress not opening posts with only numbers if permalink is post_name

Sorry I didn’t follow up on this. You mentioned you weren’t using date archives. You can change the date archive structure to remove the conflict with /%postname%/: function wpa_change_date_structure(){ global $wp_rewrite; $wp_rewrite->date_structure=”date/%year%/%monthnum%/%day%”; } add_action( ‘init’, ‘wpa_change_date_structure’ ); So now after permalinks are flushed, date archive URLs will be prefixed with date/, so numeric postnames will … Read more

Custom Post Type permalink shows wrong page: homepage/index.php

post_type needs to be max. 20 characters, can not contain capital letters or spaces, in register_post_type(); function your post type name is capitalize Portfolio replace with lower letters portfolio this is my register post type snippet, follow it // add action register our post type portfolio add_action( ‘init’, ‘register_cpt_portfolio’ ); // Register our Custom Post … Read more

Use menus with anchors

Got it — needed to use a walker function. I used a slightly modified version of the one in this tutorial The main thing I modified was changing $attributes .= ! empty( $item->url ) ? ‘ href=”‘ . esc_attr( $item->url) .'”‘ : ”; to $attributes .= ‘ href=”#’ . esc_attr( basename(get_permalink()) ) .'”‘ ; but … Read more