1

I have a page /page1 and 2 articles /article1 and /another-article1.

Which query string parameter for index.php is available to show the content?

I tried:

  • ?p= but

    • index.php?p=page1 is working
    • index.php?p=article1 displays a search result page showing the 2 articles instead of just displaying /article1 (probably because they have ...article1... in common in the slug?)
  • ?page=

    • index.php?page=page1 is working but
    • index.php?page=article1 is not working obviously because it's not a page

Which parameter in index.php?parameter=slug would work to display both pages and articles?

2
  • 1
    those parameters are the query variables, aka the parameters WP_Query uses as arguments. A quick look at the WP_Query documentation lists all arguments and what they do
    – Tom J Nowell
    Commented Oct 22, 2021 at 9:24
  • 1
    also, what problem are you trying to solve by doing this? Can you provide some context? It will improve the answers you get and make it easier to understand yoour question
    – Tom J Nowell
    Commented Oct 22, 2021 at 9:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.