Giving different Post page for same type based on category or Custom Taxonomy - wordpress

I'm having a site which has option to add hotels and restaurants. Both for them has different custom fields which i have added meta boxes with a plugin. But the custom fields of hotel are not needed for restuarant and vice versa.
So what I want to achieve is create extra menu on admin panel saying Add Restaurant & Add Hotel. When clicked on Hotel its should only show the custom fields configured for Hotel. I know this can be achieved by custom post types. But i don't want another post type unless i have no options.

Figured out that this is not the right place to ask.
Better try codex.

Related

WooCommerce: any way to split or clone the tags mechanism inside each product?

I have some task related to WooCommerce.
I need to create a perfume shop. And the task is to create for each perfume the "Perfume Pyramid".
Each perfume made from Top Notes, Middle Notes and Base Notes.
Inside each product i want to show this notes based on the notes i will select inside admin.
Each note should be clickable. When the user will click on some note, for example "vanilla" the user will redirect to the page with all the products that have "vanilla" note.
This is similar to how tags working. But i really don't know how to split / clone the tags mechanism so i will have 3 fields inside each product that will allow me to choose the notes for Top, Middle and Base.
Also, if it is possible to upload image for each tag so i can show tag as image instead text
Maybe you can suggest another way then using tags mechanism.
Thanks
You create 3 Taxonomy : base note, middle note, top note
Taxonomies are "categories", like Tags. You can link the taxonomy to one or many custom post type. In your case link the taxonomy to the "custom post type" Product created by WooCommerce.

Add taxonomy terms under one place in the admin dashboard

So I have created a custom taxonomy and two custom post types and each of these custom post types should be able to be part of a taxonomy term. Right now to add more terms I have to go to the tab beneath the custom post types. I would like to have a menu tab that's visible right away, not hidden beneath the CPT, and I only want one place where you can add more terms to my taxonomy. Is this possible with a plugin or can I easily extend the admin interface?
You can extend the admin interface by creating your own plugin. Check out the plugin handbook to learn more about it. In particular have a look at the administration menus sections.
Use plugin Custom Post Type UI. This has many features available

Wordpress Custom Post Type categroies

I have a custom post type called STORIES.
When a user adds a new STORY, I need them to be able to assign a category (or multiple categories) to the post so I can sort them later by category.
To do this, I only want specific categories I assign to the STORY posts to show - NOT all of the wordpress categories attached to every post type.
For example the default Wordpress category is 'Uncategorized'. How do I remove this category (and any othersI don't want) to ONLY show the ones I select via the custom post type editor?
Is there any way I can make this happen?
I am using custom Post Types UI with Advanced Custom Fields.
You can do that with Post Types UI, You will need to create a new taxonomy.
Here is the screenshot explaining that
https://s.w.org/plugins/custom-post-type-ui/screenshot-4.png?r=1180724
Just fill the text boxes with appropriate names, and check STORY under
"Attach to Post Type" option.
After that you will have custom taxonomy like "Story Category" to use for stories only.

Custom fields button on category pages

I have looked into http://codex.wordpress.org/Custom_Fields. And know how to target custom posts and output them on a page.
Now i need to create custom fields in all posts inside category.php and inside single.php.
I will make fields to be two buttons and later that will link to other pages.
However i can't find answer how i am supposed to add custom fields to specific category posts. Ofcourse every post with buttons will have a unique link.
Could anyone point me in the right direction how i am supposed to create custom fields in all posts of a specific category?

Filtering my products on drupal commerce

I have imported 5.000 to my drupal-commerce website.I want the user to be able to navigate fast on all of these products,so I just figured out that I need to make somehow a filter or a search that when the user chooses/selects some of the features of the product the result will be only the products with these features.How can I manage to do this on Drupal 7 and Drupal Commerce(Commerce kickstart?)
The short answer is that you'll probably want to use the Views module. You can create a Views page display for your main products page that loads the Commerce product displays. Since the product displays don't actually contain the field values that you'd want to filter (they're on the referenced products), you'll need to add a Relationship to the products. That'll let you add filter criteria for product fields (exposing them will make them visible to the user). If you want the exposed filters to appear in a sidebar, use the "Exposed form in block" option on the Views display to create a filter block that you can add to your sidebar region on Administration » Structure » Blocks (/admin/structure/block).
Most people who have used Views over the years are used to outputting the Views result using Fields and then customizing the display of the fields with template files or extensive configuration, etc. However, you can create a custom view mode for your product display content types and give them layout with Display Suite. You can output those custom displays in Views using the Content Format.

Resources