Add comment feature to woocommerce Shop page

Woocommerce itself has an option to view comments from dashboard without editing the core. Please Read the documentation fully. But, You need to code little to view the comment option only on shop page. (Suggestion: Enable comment in all pages and do display:none on #comment where ever you don’t need it.)

How change menu for each user in plugin?

Create a menu for each type of user in Dashboard >> Appearence >> Menus >> create a new menu (eg http://example.com/wp-admin/nav-menus.php?action=edit&menu=0) Then add a function to your theme’s functions.php to switch the menus. Something like as follows: add_filter(‘wp_nav_menu_args’, ‘wp_nav_menu_args_filter’); function wp_nav_menu_args_filter($args = array()) { if (is_user_logged_in) { // Menu for Logged In Users $args[‘menu’] = … Read more

How to add plugin activity in the menus?

Go to your dashboard->appearence->menus Select the menu where you want your link for this plugin Now create a custom link from the custom Links box at left side as: enter the url as:http://www.your_site_name/answers/ and enter the label as anything you want to display in your menu add this custom menu in any postion in your … Read more

How to get the parameters on page and avoid 404?

The conjunction of add_rewrite_rule() & add_rewrite_tag() is a little bit tricky, perhaps you could use parse_url hook what came useful for me. The code below is to catch multiple paramete=value separated with slash. Code – add_filter( ‘parse_request’, ‘wpse128790_parse_request’ ); function wpse128790_parse_request( $wp ) { $pageslug = ‘mypage’; if( isset($wp->request) && strpos($wp->request, “https://wordpress.stackexchange.com/”) ) { $requests … Read more