I'm creating a unique design for a Woocommerce webshop and I've run into a problem. I want the end-user to be able to add categories and also add custom menu's on those created pages.
Any of you guys have a brilliant idea how to do that? I thought I would put the wp_title() of the page in a variable and put the code for a menu on my category page-template with that variable, but that doesn't seem to be the solution. Any brilliant thoughts?
Extra info: the reason why my own solution will never work, is because you can't register the menu in your functions.php with a variable name..
The easiest method of doing this would be to create the pages you need for your nav and then add the WooCommerce shortcode to the page.
[product_category category="example" per_page="12" columns="4" orderby="date" order="desc"]
Related
Default whole woocommerce category content and replace it with custom value or replace woocoomerce category page with another just by calling in plugin.
based on this link it seems there is no action for whole shop category page content.
its important to doing this with custom plugin and not any changes on template.
i found a simple answer.
use JS to hide shop loop divs and add my plugin resluts to woocommerce_before_shop_loop.
Attention: this is not a really good solution.
I installed WooCommerce. WooCommerce setup 5 pages like: Shop, Cart, Account, Privacy and Pay.
Everything works fine but WooCommerce shows only the main categories.
My settings in the WooCommerce dashboard set to show subcategories but nothing is happening.
How I can fix this?
If you switch to a default theme like Twenty Seventeen, do the sub-categories show up?
If so, I would suggest talking to your theme author.
If not, Try re-saving your products and categories and clearing the cache.
I solved the problem.
I added the woocommerce support in my theme.
Then I created a new page called woocommerce.php
In this fil you run a loop with woocommerce_content();
This line is required in div tags with class woocommerce.
This is important for the default style!
The file look like this
<div class=“woocommerce”>
<?php woocommerce_content(); ?>
</div>
i'm trying to add woocommerce product categories on a single page, but can't find a solution.
i've tried using these shortcode, but they don't work:
[product_categories number="14"]
or
[product_category category="snowpeak" per_page="12" columns="4" orderby="date" order="desc"]
but i don't get any results. the page is just empty. am i doing something wrong?
is there another way of displaying product categories on a single page? i want to use this page as the homepage. i don't have too much experience with wordpress and don't know how to fix this.
i'm using the latest versions of wordpress and woocommerce. thanks for your help!
I am preparing the site like w3schools using wordpress.
There are two things i can add post or page.
I want to add a page which describe the doctype in HTML category.
1) Is it possible to add a page under sub-category bccause pages are added under menu.
I am having HTML, Jquery, PHP etc category and there will be subcategory under thing like doctype, li, ul, meta etc. On home page it will show all category and on clicking on category. It will show all sub-category under that.
Please guide me how to do the above.
Thanks in advance
There are two ways to implement
1)Posts: create categories and respective nested sub-categories in posts rather than pages. then put content under posts.
2) Pages: create nested pages then apply templates to the pages.
To get all categories on home page:
use get_pages() or get_posts() in an array. then loop through the array to get all top level pages and their child pages' titles.
Better to use posts. Then you can use categories and tags.
I am having some problems structuring a Wordpress Website.
Basically this website will have the following pages:
Home
Portfolio
News
Contact
The home will be designed by the index.php, that is no problem. In this page I will show some of the posts that should be in the News and some that should appear in Portfolio.
The pages Portfolio and News should present a list of posts that match this category.
Contact is a normal static page.
My idea was to create a static page for portfolio and for news and to change its theme so I get a list of posts matching this category and handle it. But I found out that this does not work as I thought because pages are not meant to this. For this reason some functions (as the_content) do not work. So I found about Category Templates, which seem exactly what I want.
But now my problem is: my menu is being built automatically and I find it nice. Using the category page template would cause me to need to build it manually, which looks like (for a newbie) a bad smell, once it can be built automatically.
Is the approach with Home->index.php, news and portfolio -> category template and contact -> static page a nice approach?
How would I build the menu in a elegant way with this approach?
Thanks!
Oscar
I don't think your approach was the best, I would have used page templates to pull the different layout/type of pages and use the front-page.php to create the homepage.
But every dev has his own way, I guess.
I think you can easily solve your problem building the menu with the built-in menu builder of wordpress. You can go in Appearance > Menu if your theme is compatible with that.
Check further documentation here
hope it helps!
cheers
In wordpress you can add static page or categories or any other pages to wordpress menu. For creating menu in wordpress see this links.
creating menu