I need to create a new page which will have same functionality of one the page of admin.
I have a page which is accessed by /wp-admin/post-new.php?post_type=shop_order.
I have made a copy of this page by the name "new-post0.php" but when I access new cloned page , its content is different!
I m missing something at registering this new page?
You shouldn't copy and paste Wordpress core files. That's called "hacking the core" which is very very bad.
http://websynthesis.com/dont-hack-wordpress-core/
You should instead develop your "new-post" page as a new custom post type.
You can learn about them here:
http://codex.wordpress.org/Post_Types
The link /wp-admin/post-new.php?post_type=shop_order you posted refers to a new post page for a custom post type.
To get another page like that, you'll need to create another custom post type and add the custom meta fields.
If you can't code it, there are plugins that you can use to achieve the same results.
Custom Post Type UI to create custom post types and ACF for custom fields. Right now, you should download ACF from Github.
Related
I have a custom post type that I would like to have the archive page be based on a page template. So that I would create a page using a template, and then assign that page to act a custom post type archive.
I see this being in done for WooCommerce where you select which pages are to be what section, or in buddy press.
but not sure how to go about it with general custom post types and archives.
There are two ways:
1.) If the page template already contains the custom loop which calls those CPTs, create an empty page in the WP backend and select your page template as its page template.
2.) Or rename your page template php file to "archive-xxxxx.php", where "xxxxx" should be replaced by your CPT name. (see also https://developer.wordpress.org/themes/basics/template-hierarchy/ for details).
What you can do better is set the archive to false and create a custom loop yourself. you can insert it via a shortcode (woocommerce used to do it this way too).
I want to create a custom post type to manage some things on wordpress. But i don't want that the post create a single page to each and single one.
How can i disable this function of wordpress?
While creating the custom post type, You can disable the permalink section. Please check on this thread,
https://wordpress.stackexchange.com/questions/108652/remove-custom-post-type-permalink
I have made a template custom type with custom field. What I need to do is make a copy of that post so that all the data and custom field could be copied to new custom post type. So that I could change the certain part of that project.
Might be some plugin m looking for.
there is a plugin for dublicating the post types
please check the link here the plugin http://wordpress.org/extend/plugins/duplicate-post/. it provides a clone option on the list where quick edit resides
When creating a custom post type and fill it with some posts wordpress generates a page for that custom post type.
But I want to be able to add content to that page so I create a regular page and choose a template where I manually call the custom post type posts and loop them out. And now I can just add content in the wysiwyg editor. But this causes a conflict between these two pages, especially if the CPT has the same name as the page.
And now the question: Is there a way to always show the page where I have chosen the template for the CPT to always show? Even when someone try's to manually enter the url for the CPT generated page?
Here is what I understood from your question. You have custom post type. Then you created a page-template, that loops through your custom post types and output them. Now when you create a new page and assign it the page-template you have created you run into problems, if it has the same name as the custom post type.
Solution: I think what you need to do is change the custom-page slug from the admin menu. Then you would be able to directly reference it by the URL.
So I've just made a custom post type for my wordpress theme named "Products". When I create a new post in it and view it, the link is something like this:
"http://localhost/wordpress/product/a-product-title"
This page views as expected but when I try to go to the supposed parent page:
"http://localhost/wordpress/product/"
I get a 404 error page. Is there a special template I need to make to view this page?
Thanks
I found what to do. I just created a new page called "Products" and set it as the posts page. Then I put this in front of the loop
$wp_query = new WP_Query("post_type=product");
and it worked
I had the same issue - I think it's down to the fact that right now, WP 3.0 simply does not behave as you would expect with custom post type 'archives'.
Check out Smarter Custom Posts to easily build-in this behaviour.
The name Products is also used by Woocommerce so be aware that if you install this too, the custom post type will stop working.