Link from page to category posts

Instead of hard-coding the pages, categories and sidebars in your template file(s) you could consider registering a custom metabox to store the category relation (i.e. the category term ID) in the page post meta. This way you could make the sidebar handling dynamic. The first step would be to register, render and handle the saving … Read more

Error while add Category or Tag in WordPress

Rename the “plugins” folder in “wp-content” and create a new empty “plugins” folder. Test if the error persists. Temporarily revert any custom code or modifications in your theme. Add a higher memory limit to “wp-config.php.” Use the “WP-Optimize” plugin to optimize and repair the database. Check for error messages by enabling WordPress debugging in “wp-config.php.” … Read more

Adding 400 product categories with their hierarchy to a navigation menu

Ok, I found a solution. I used a combination of a plugin that allows me to add shortcode to menus and creating a new shortcode for product categories in functions.php. Here is the code for the shortcode: function display_product_categories_hierarchy($parent_id = 0, $first = true) { $args = array( ‘taxonomy’ => ‘product_cat’, ‘hide_empty’ => false, ‘parent’ … Read more