Skip to content

Instantly share code, notes, and snippets.

@SanjeevMohindra
SanjeevMohindra / function.php
Last active December 20, 2015 01:28
Enable Genesis 2.0 via Function.php
add_theme_support( 'html5' );
@SanjeevMohindra
SanjeevMohindra / function.php
Created July 21, 2013 15:43
Correct the Top Navigation in Metro theme with Genesis 2.0
// Adds widget area before the .menu on #subnav
add_filter( 'genesis_do_subnav', 'child_do_subnav_widget', 10, 2 );
function child_do_subnav_widget( $subnav_output, $subnav ){
ob_start();
genesis_widget_area( 'subnav-left', array(
'before' => '<div class="subnav-left widget-area">',
'after' => '</div>'
) );
$widget_area = ob_get_clean();
@SanjeevMohindra
SanjeevMohindra / function.php
Created July 21, 2013 16:03
Correct the After Post Widget in Metro Child Theme with Genesis 2.0
add_action( 'genesis_entry_footer', 'metro_after_post' );
@SanjeevMohindra
SanjeevMohindra / function.php
Created September 3, 2013 17:41
Remove Author Box For Selected CPT
function remove_author_box( $post_id ) {
// - Update the array for selected CPT, where you do not want to display the author box
$CPT = array('a'=>'Woocommerce', 'b'=>'WP Deals Engine');
// If this isn't a selected CPT post, don't update it.
if ( in_array ($_POST['post_type'], $CPT )) {
// - Update the post's metadata.
update_post_meta( $post_id, 'author_disp', 'NO');
}
}
add_action( 'save_post', 'remove_author_box');
@SanjeevMohindra
SanjeevMohindra / function.php
Created October 29, 2013 17:54
Video Embed Shortcode for YouTube with Schema Markup
// YouTube ShortCode [youtube src="" title="" duration="" thumbnail="" description=""]
function youtube_shortcode( $atts ) {
extract(shortcode_atts(array(
'src' => '',
'title' => '',
'duration' => '',
'thumbnail' => '',
'description' => ''
), $atts));
$video_tag = '<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
@SanjeevMohindra
SanjeevMohindra / style.css
Created October 29, 2013 18:26
Video Embed Shortcode Style
/************ Responsive Video *********/
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
@SanjeevMohindra
SanjeevMohindra / blog-post
Last active December 26, 2015 23:59
Example of YouTube Shortcode
[youtube src="SHxP5Jd9Lm8" title="Rename Multiple Files Through Automator" duration="T6M18S" thumbnail="test.jpg" description="This is a test embed"]
package callbyvalue;
public class PrimitiveCall {
public static void main(String[] args) {
int x = 10;
System.out.println("Value of x before the call: " + x);
add(x);
System.out.println("Value of x after the call: " + x);
}
package callbyvalue;
public class ObjectCall {
public static void main(String[] args) {
TempNum z = new TempNum(10);
System.out.println("Value of x before the call: " + z);
add(z);
System.out.println("Value of x after the call: " + z);
}
package callbyvalue;
public class ObjectCallWithCreate {
public static void main(String[] args) {
TempNum z = new TempNum(10);
System.out.println("Value of x before the call: " + z);
add(z);
System.out.println("Value of x after the call: " + z);
}