Hello friends!. If you want to add the donate form on your website then just used code given below: <form name="_donations" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <div><div>First Name: <font color="red">*</font></div><input type="text" name="first_name" value=""><div></div></div> <div><div>Last Name:<font color="red">*</font></div><input type="text" name="last_name" value=""><div></div></div> <div><div>Phone Number:</div><input type="text" name="night_phone_a" value=""><div></div></div> <div><div>Address1:<font color="red">*</font></div><input type="text" name="address1" value=""><div></div></div> <div><div>Address2:</div><input type="text" name="address2" value=""><div></div></div>
Hello friends! Hope you doing well :) If you want to sort the array on base of array key then just follow my code given below: <?php $myarray = array( array("name"=>"Bob","price"=>8,"colour"=>"red"), array("name"=>"Greg","price"=>12,"colour"=>"blue"), array("name"=>"Andy","price"=>5,"colour"=>"purple")); $sortArray = array(); foreach($myarray as $person){ foreach($person as $key=>$value){ if(!isset($sortArray[$key])){ $sortArray[$key] = array(); } $sortArray[$key][] = $value;
Hello Everyone! If you want to get the category id and category slug of current category page , then use my code :) $cur_cat = get_cat_ID( single_cat_title("",false) ); //get the cat id $category = &get_category($cur_cat); $category->slug; //get cat slug Enjoy Code!
Hello Everyone, If you want to add the .html in category page url without using any plugin then just add my code in your function file https://www.wp-experts.in/blog/mycategory.html function add_before_and_after_rewrite() { add_rewrite_tag("%cat_id%", '([^/]*)'); /*add_rewrite_tag("%video_src%", '([^/]*)'); add_rewrite_tag("%video_title%", '([^/]*)');*/ // Before And After //add_rewrite_rule('services.html', 'index.php?category_name=services', 'top'); //add_rewrite_rule('services.html', 'index.php??cat=8', 'top');
Hello Friends! :) If you want to create a custom sort order on product list page then you have need to follow my steps given below: Firstly you have need to create a custom field in admin, so for that just add given code in your theme function files //Start code for custom meta box
Hello Friends! If you are using the wp e-commerce plugin and want to change the “Cart Quantity” value as per you entered the value during “Add To Cart” then don’t worry, just follow my steps. Firstly you have need to find out “cart.class” files in your plugin folders After that open this file in your
Hello Friends :) If you want to get the title of any custom taxonomy name using the term_id, then don’t worryi am here for you :) $array = get_term_by('id', term_id, 'taxonomy', 'ARRAY_A'); print_r($array[name]); Enjoy Code | Raghunath Blog
Hello Friends! :) If you want to add any text in Post URL (suffix/prefix) then just use my code function save_url_suffix($post_id) { global $meta_box; // check autosave if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } // check permissions if ('page' == $_POST['post_type']) { if (!current_user_can('edit_page', $post_id)) { return $post_id; } } elseif (!current_user_can('edit_post', $post_id)) {
Hello Friends! If you want to get the posts category title on your custom template, then don’t worry :) just use my code given below : $post_categories = wp_get_post_categories('INSERT_POST_ID_HERE'); $cats = array(); foreach($post_categories as $c){ $cat = get_category( $c ); $cats[] = array( 'name' => $cat->name, 'slug' => $cat->slug ); } foreach($cats as $index=>$val){ echo
Hello friends, If you want to get the details of children categories for a specific parent category then use my code give below: $args = array( 'orderby' => 'name', 'parent' => ENTER_PARENT_CAT_ID_HERE, 'taxonomy' => 'category', 'hide_empty' => 1 , 'number' => '1' ); $categories = get_categories( $args ); $content='';