How to use PUT, PATCH, DELETE in Laravel?

If you want to use HTTP Methods like PUT, PATCH, DELETE in Laravel then follow below steps. In form section you have to put a field like below eaxample <form class=”form-control” action=”/update” method=”post”> {{ csrf_field() }} {{ method_field(‘PUT’) }} <input name=”id” type=”hidden” value=”{{ $user->id }}” /> <input name=”name” type=”text” value=”{{ $user->name }}” /> <input name=”email”

How to modify the nav menu structure or make custom menu structure in WordPress ?

If you want to modify the nav menu structure or make custom menu structure in WordPress then add this code to functions.php file. class Nav_Walker_Nav_Menu_sitemap extends Walker_Nav_Menu{ function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0){ global $wp_query; $indent = ( $depth ) ? str_repeat( “\t”, $depth ) : ”; $class_names =

How to add css class to current menu item in WordPress ?

If you want to add css class to current menu item in WordPress. add_filter(‘nav_menu_css_class’ , ‘rs_special_nav_class’ , 10 , 2); function rs_special_nav_class ($classes, $item) { if (in_array(‘current-menu-parent’, $classes) ){ $classes[] = ‘active-item’; } if (in_array(‘current-menu-item’, $classes) ){ $classes[] = ‘active-item’; } return $classes; } Please follow and like us:

How to show subcategory inherit the parent category template in WordPress ?

If you want to show subcategory posts in parent category template then you have to include below code in functions.php file. function rs_subcategory_hierarchy() { $category = get_queried_object(); $parent_id = $category->category_parent; $templates = array(); if ( $parent_id == 0 ) { // Use default values from get_category_template() $templates[] = “category-{$category->slug}.php”; $templates[] = “category-{$category->term_id}.php”; $templates[] = ‘category.php’;

Exclude specific category, post, page from Search in WordPress ?

If you want to exclude a specific category or post or page then you have to put the id in below code. function exclude_category_search( $query ) { if ( is_admin() || ! $query->is_main_query() ) return; if ( $query->is_search ) { $query->set( ‘post__not_in’, array( 668,5004,5409,5407,4392,5416,500,502,3817,3819,4708,671) ); $query->set( ‘cat’, ‘-3625,-40’ ); } } add_action( ‘pre_get_posts’, ‘exclude_category_search’, 1

How can you change the version of style.css in WordPress theme?

If you need to change your style.css or any css file after the file edited or modified in wordpress theme then you need to add this code in your functions.php file. if(!is_admin()) wp_enqueue_style( ‘stylesheet-id’, get_stylesheet_directory_uri() . ‘/style.css’, array(), filemtime( get_stylesheet_directory() . ‘/style.css’ ) ); ‘stylesheet-id‘ this id is important please keep in mind if you