Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to use structure tags in custom post type rewrite slugs?

add_action( 'init', 'test1' );
function test1()
{
    register_post_type( 'test1', array(
        'label' => 'test1',
        'public' => true,
        'rewrite' => array(
            'slug' => 'test1/%monthnum%',
        ),
    ) );
}

This does not work. I get a 400 Bad Request when I go to the URL of a post I create.

Example of the URL I am testing

(Month is Feb - 02 or 2 neither works)

I tried the techniques mentioned here. The link to the plugin mentioned did not work and the example defining post type in functions.php did not work (400 Bad request when attempting to go to URL).

Note: I figured this out - needed to flush my permalinks.

share|improve this question

closed as too localized by toscho Mar 5 at 23:35

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.