This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a new taxonomy for a custom post type | |
* | |
*/ | |
public function register_new_CPT_Taxo() { | |
$cpt_name = 'Samhita'; | |
$sanitized_cpt = sanitize_title($cpt_name); | |
$all_taxonomy = array('Veda'); | |
foreach ($all_taxonomy as $single) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Change the featured image metabox title text | |
*/ | |
function as_change_featured_image_metabox_title() { | |
remove_meta_box( 'postimagediv', 'YOUR_POST_TYPE', 'side' ); | |
add_meta_box( 'postimagediv', __( 'Header Background Image', 'as' ), 'post_thumbnail_meta_box', 'YOUR_POST_TYPE', 'side' ); | |
} | |
add_action('do_meta_boxes', 'as_change_featured_image_metabox_title' ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Step 1 - Login to https://github.com/ | |
Step 2 - Create a new repository https://github.com/new | |
Step 3 – optional – Add description | |
Step 4 – optional – select check box showing “Initialize this repository with a README”” | |
Step 5 – optional – Select appropriate “gitignore”. | |
Step 6 – optional – Select appropriate “License”. | |
Step 7 – Click on “Create repository” | |
Step 8 – Click on link named as “clone or download” and copy the URL named as “Clone with HTTPS” | |
Step 9 – Go to https://desktop.github.com/ | |
Step 10 – Download “github desktop” for window 7 or later |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'post_thumbnail_html', 'remove_thumbnail_dimensions', 10 ); | |
add_filter( 'image_send_to_editor', 'remove_thumbnail_dimensions', 10 ); | |
function remove_thumbnail_dimensions( $html ) { | |
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html ); | |
return $html; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ref - https://codex.wordpress.org/Plugin_API/Filter_Reference/ajax_query_attachments_args | |
add_filter( 'ajax_query_attachments_args', 'show_current_user_attachments', 10, 1 ); | |
function show_current_user_attachments( $query = array() ) { | |
$user_id = get_current_user_id(); | |
if( $user_id ) { | |
$query['author'] = $user_id; | |
} | |
return $query; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$taxoName = "dummy_taxo"; // Taxonomy Name | |
// Associative array of default arguments for Query | |
$args = array( | |
'taxonomy' => $taxoName, // Passed Taxonomy Name | |
'parent' => 0, // Get only top level terms | |
'hide_empty' => False // Get all the Terms | |
); | |
?> | |
<form action="" method="post"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Hello User!</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
$(".element span").text(function(index, text) { | |
return text.replace('old text', 'next text'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add same class in each li | |
jQuery(document).ready(function() { | |
jQuery('#menu-primary li a').each(function() { | |
jQuery(this).attr("class", "nav-link"); | |
}); | |
}); | |
// Add class in each li | |
jQuery(document).ready(function() { | |
jQuery('#menu-primary li a').each(function(n){ |