WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i create a new post-type called servizi. I customize the permalink for this structure: /%post_id%/%postname%/ But there are a different width post link . For example the post link is www.mysite.it/site-wp/25/postname/ and the servizi's link is www.mysite.it/site-wp/servizi/postname/. I dont't understand what is the trouble .

In details page how can take the post_id variable? I use $_GET or i customize my function.php with special function?

Someone can i help me please?

share|improve this question

Is the reason you are adding the post_id to the URL because you are you trying to access the post_id variable in the template? You can do so much more easily by accessing it in the Loop of your template file

if ( have_posts() ) : 
    while ( have_posts() ) : 
        // Two ways to get the Post ID //
        echo $post -> ID; 
        echo get_the_ID();
    endwhile; ?>
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.