Put post ID on the custom post type URL

It’s quite easy, actually: Change the generated permalink structure so that it ends with the post ID and not the post slug (but it still contains the post slug): // After you registered the post type: register_post_type( ‘ex_article’, $args ); // .. run this code: global $wp_rewrite; $wp_rewrite->extra_permastructs[‘ex_article’][‘struct’] = ‘sa/%ex_article%/%post_id%’; Then replace the post ID … Read more

Permalink Structure problem with cpt and custom taxonomy

Welcome to WP StackExchange! You may want to try something like this, which uses the same rewrite setting as your register CPT: $args = array( ‘rewrite’ => array(‘slug’ => ‘events/ecat’, ‘with_front’ => false) ); register_taxonomy( ‘ecat’, array( ‘events’ ), $args ); Sources: https://cnpagency.com/blog/the-right-way-to-do-wordpress-custom-taxonomy-rewrites/ https://codex.wordpress.org/Function_Reference/register_taxonomy#Arguments

Relative or Absolute Paths for Flash Video Player Files

When dealing with WordPress and Flash, we have to use always absolute URLs. When embedding, when referencing inside the ActionScript, in XML files and when dealing with Remoting. This way is hassle free. I put my SWFs inside wp-content/swf/ and use the URL http://example.com/wp-content/swf/my-flash.swf. There’s nothing virtual about this, it has to be real.

How to get rid of index.php?

This is a classical case. All you need to do is to use Rewrite Rules. With Apache, you can do it in .htaccess: # 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 More on this in codex.

Custom permalink structure

I’ll look into the last two soon but for the top 3 you could do the following: mysite.com/post-type-slug/post1: This defaults to the post type name you specify when registering it but can be altered by changing the rewrite argument in the register_post_type() call. register_post_type( ‘posttype’, array( // … all the other args… ‘rewrite’ => array( … Read more