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 7712893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:44:17+00:00 2026-06-01T01:44:17+00:00

I create a post and then it says i has been published but when

  • 0

I create a post and then it says i has been published but when I click the url I get a page not found!

Here is my custom post set up code:

add_action('init', 'offered_register');
function offered_register() {

$labels = array(
    'name' => _x('Offered items'),
    'singular_name' => _x('Item'),
    'add_new' => _x('Give an item away'),
    'add_new_item' => __('Give a new item away'),
    'edit_item' => __('Edit item'),
    'new_item' => __('Give Item Away'),
    'view_item' => __('View Item'),
    'search_items' => __('Search Offered Items'),
    'not_found' =>  __('Nothing found'),
    'not_found_in_trash' => __('Nothing found in Trash'),
    'parent_item_colon' => ''
);

$args = array(
    'labels' => $labels,
    'public' => true,
    'publicly_queryable' => true,
    'show_ui' => true,
    'query_var' => true,
    'menu_icon' => get_stylesheet_directory_uri() . '/images/article16.png',
    'rewrite' => true,
    'capability_type' => 'post',
    'hierarchical' => false,
    'menu_position' => null,
    'supports' => array('title','thumbnail', 'custom-fields','comments')
  ); 

register_post_type( 'offered' , $args );
}
  • 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-01T01:44:19+00:00Added an answer on June 1, 2026 at 1:44 am

    Your register_post_type() function looks fine. I’m guessing that you have pretty permalinks enabled. Visit the Settings > Permalinks page and try again.

    Then read this:
    Flushing Rewrite Rules on Plugin Activation

    The issue is that when a new post type is registered, the rewrite rules that WordPress uses to handle pretty permalinks do not automatically get re-generated. flush_rewrite_rules() must be called to pick up the new post type rewrites. This is commonly done in two ways:

    1. If you’re working on a plugin, add flush_rewrite_rules() to the plugin activation hook callback (see the link above)
    2. Visit the Settings > Permalinks page, which calls flush_rewrite_rules() for you

    What you do not want to do is call flush_rewrite_rules() in the init callback — it is not something you want called on every page request.

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

Sidebar

Related Questions

My table 'Post' has field: id, name, content, post_id When i create new post,
I'm trying to create an auto generated post excerpt from the current page's post
(Note: This post has been edited to show specific use case. See bottom.) I
There are many similar questions, but I have not found exactly what I am
I'm trying to create a POST request, unfortunately the body of the POST never
I'm trying to create a post button that inserts the latest posts into a
is there a way to create custom post variables when a user presses submit,
I have the following code: // // POST: /PlayRoundHole/Create [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(FormCollection collection)
Im trying to create an ajax (post) event that will populate a table in
Help, I'm trying to create a new post in my wordpress blog with custom

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.