• Hello
    My permalink addresses are the default now:
    https://www.irannopendar.com/?page_id=123

    I would like to know the custom code for the above structure. In fact, I want to include the page title in the permalink without removing the page_id. I tried the following custom structures in the custom permalink settings, but neither worked:
    /?page_id=%post_id%&page_title=%postname%
    /%postname%/?page_id=%post_id%
    /%postname%/”?page_id=”%post_id%

    I tried whatever coming to my mind, but neither worked. How can I add the page title to my permalink without removing the part that says “?page_id=123”?

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Just a note on this:

    Set your permalinks setting to:

    /%postname%/

    Now you can navigate to a post by title (a page is a special post type).

    yoursite.com/post_title

    but:

    You can still get there using the page or post id. Let’s assume the post id for the example is 24 so the URL to it would be:

    yoursite.com/?p=24

    When you visit that URL, you will end up at (the url is rewritten):

    yoursite.com/post_title

    This does not work in reverse.

    Does that help?

    Thread Starter javad2000

    (@javad2000)

    Hello
    Thank you for the reply. This does not solve the problem. I want to include both page title and page number in one address, not in two separate addresses. I would like to include the page titles for SEO purposes. At the same time I want to include the page number, because I have designed a statistical plugin that counts the number of visits from each page by getting the page_id. Is there a way to include both of them at a time?

    Thank you

    Since this is all related in your DB, knowing one (the slug or the post id) will surely let you know the other, I believe you just need to begin to think of this task in a different manner.

    Let’s clarify for all:

    If you know the slug, you can find it’s related post id.

    If you know the post id, you can find the slug.

    Your described method is therefore unnecessary.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add a specific word to the permalinks?’ is closed to new replies.