Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8475171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:49:24+00:00 2026-06-10T17:49:24+00:00

Ok I have made my custom post type and they work fine(code shown below).

  • 0

Ok I have made my custom post type and they work fine(code shown below). But I cant seem to make a default page for it for example example.com/php < how do I get that page. I can make pages like example.com/php/some page/ and they work fine.

$labels = array(
'name' => _x('PHP', 'post type general name'),
'singular_name' => _x('PHP', 'post type singular name'),
'add_new' => _x('Add New', 'PHP Page'),
);
$args = array(
'labels' => $labels,
'taxonomies' => array('post_tag'),
'public' => true,
'publicly_queryable' => true,
'show_ui' => true, 
'show_in_menu' => true, 
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => true, 
'hierarchical' => true,
'menu_position' => null,
'supports' => array( 'title', 'editor', 'page-attributes')
 ); 
register_post_type('php',$args);

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:49:26+00:00Added an answer on June 10, 2026 at 5:49 pm

    I’m not sure if there is an intuitive way to do this in WordPress (you might want to check over at https://wordpress.stackexchange.com/). However, I’ll explain how I have done this before.

    Create a new page template, say, php.php, with whatever you want the “default” page to do. Usually, I include a loop that only pulls from my custom post type.

    <?php
    /*
    Template Name: PHP Default Page
    */
    // ...
    query_posts("post_type=php");
    // ...
    ?>
    

    Then, create a page within the WordPress dashboard titled “PHP” (so it will have the permalink, http://example.com/php)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom WordPress plugin I made and it doesn't seem to work
I have made a custom UISwitch (from this post) . But the problem is,
I made some meta_values under a custom post type called 'Show'. I have confirmed
I have cells in UITableView , I have made custom frame for the label
I have made a custom form in a module where I have used a
I have made a custom formwizard and incorporated it into my admin interface. Basically
I have made my custom module in magento, in which I have set discount
I have made a custom suface button according this example: <Button> <Button.Template> <ControlTemplate TargetType=Button>
i have made my custom Static Library (.a) successfully. i have tested it in
I have made a custom NSView and have implemented the keyDown: method. However, when

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.