Skip to content

Instantly share code, notes, and snippets.

View shohag-biswas's full-sized avatar

Shohag Biswas shohag-biswas

View GitHub Profile
@shohag-biswas
shohag-biswas / mwp-metabox.php
Created February 6, 2018 16:01
This is how to add metabox in WordPress page or post
<?php
/*
check out the full tuts: https://www.ministryofwp.com/how-to-add-wordpress-meta-box/
*/
function add_guest_details() {
add_meta_box('guest-details', 'Guest details', 'guestcallback', 'post', 'side', 'high');
}
@shohag-biswas
shohag-biswas / custom-widget.php
Created February 6, 2018 15:49
This is how to create custom widget
<?php
/*
*Creating custom widgets
*Check out the tuts: https://www.ministryofwp.com/build-custom-wordpress-widget/
*/
class mwp_wid extends WP_Widget{
function mwp_wid(){
@shohag-biswas
shohag-biswas / header-code.php
Created February 6, 2018 15:41
Sample for adding codes in header
<?php
/*sample code to inject code in HEAD tags*/
/*check out the tutorials: https://www.ministryofwp.com/add-codes-in-child-theme-header/ */
add_action('wp_head', 'mwp_header_code');
function mwp_header_code(){
?>
<script type="text/javascript">
@shohag-biswas
shohag-biswas / menu-footer
Last active August 10, 2016 20:04
Add menu in footer
/**make sure you are adding search in top right widgets **/
.site-header .widget-area {
/* float: right; */
width: 500px;
margin: 0 auto;
}
.title-area {
font-weight: 700;
@shohag-biswas
shohag-biswas / woo-custom-signup-form.php
Created May 7, 2016 05:58
Woo custom sign up form
/**
* Add new register fields for WooCommerce registration.
*
* @return string Register fields HTML.
*/
function wooc_extra_register_fields() {
?>
<p class="form-row form-row-first">
<label for="reg_billing_first_name"><?php _e( 'First name', 'woocommerce' ); ?> <span class="required">*</span></label>
@shohag-biswas
shohag-biswas / woo-extra-stock-option.php
Last active May 14, 2020 10:12
Woocommerce Extra stock option
/*adding stock option*/
function add_custom_stock_type() {
?>
<script type="text/javascript">
jQuery(function(){
jQuery('._stock_status_field').not('.custom-stock-status').remove();
});
</script>
<?php