Skip to content

Instantly share code, notes, and snippets.

View jayshreehcl's full-sized avatar

Vivek Kumar Poddar jayshreehcl

View GitHub Profile
@jayshreehcl
jayshreehcl / functions.php
Last active May 25, 2017 14:02
Learn how to enable DNS Prefetch and DNS Prerender in WordPress. You can read complete tutorial at http://blogprime.com/dns-prefetch-prerender-in-wordpress-with-instant-articles-plugin
<?php
/* Please don't copy the opening <?php tag */
function blogprime_homepage_dns_prefetch() {
/* variable for storing the homepage url */
$homepage = get_home_url();
/* variable for storing the next post url */
$next_post = get_next_post();
/* variable for storing the previous post url */
$prev_post = get_previous_post();
@jayshreehcl
jayshreehcl / function
Created January 10, 2016 09:51
This snippet is for adding custom widget area above header. http://wpvkp.com/add-custom-widget-above-header-in-genesis-theme/
add_action( 'genesis_before_header', 'wpvkp_bhw', 9 );
function wpvkp_bhw() {
genesis_widget_area( 'before-header', array(
'before' = '<div class="bh widget-area">',
'after' ='</div>',
) );
}
/** Customize Genesis Footer */
/** This snippet will help to modify the complete genesis footer area */
/** For Non HTML5 Websites */
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'wpvkp_footer' );
function wpvkp_footer() {
?>
<p>&copy; Copyright 2014 <a href="http://mysite.com">MySite</a> &middot; All Rights Reserved &middot; And Our <a href="http://mysite.com/sitemap.xml" target="_blank">Sitemap</a> &middot; All Logos &amp; Trademark Belongs To Their Respective Owners&middot; </p>
<?php
/*
** http://wpvkp.com/add-social-media-sharing-buttons-to-wordpress-without-plugin/
** @blogvkp
** http://wpvkp.com/
*/
// Function to handle the thumbnail request for pinterest
function gpt_src($img)
@jayshreehcl
jayshreehcl / form.html
Created July 31, 2015 06:22
This is the form fieldset for the the responsive html and css form I have created at http://designvkp.com/create-responsive-forms-using-html-css/
<form action="takeaction.php" method="post">
<h1>Sifalri 2015</h1>
<fieldset>
<legend><span class="number">1</span>Enter Your Details</legend>
<label for="name">Name:</label>
<input type="text" id="name" name="user_name">
<label for="universityname">University/Collage:</label>
@jayshreehcl
jayshreehcl / main.css
Created July 31, 2015 06:21
This is the main stylesheet for the responsive html form I have created. You can check the complete tutorial at http://designvkp.com/create-responsive-forms-using-html-css/
*, *:before, *:after {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: 'Nunito', sans-serif;
color: #384047;
background-image: url('pattern.png');
background-position: 0px 0px;
@jayshreehcl
jayshreehcl / function.php
Created April 2, 2015 14:10
Code snippet to show recent posts from category in wordpress. For more information on how to use it properly and other alternatives please refer to : http://wpvkp.com/show-latest-posts-from-category/
<?php
function cust_post() {
$check = new WP_Query( array( 'category_name' => 'nameit', 'posts_per_page' => 5 ) );
if ( $check->have_posts() ) {
// To enable the theme's default style for list elements
$string .= '<ul class="cust_post widget_recent_entries">';
// Checks if the post is present in the category
while ( $check->have_posts() ) {
<?php
// Add search form to secondary navigation in genesis.
add_filter( 'wp_nav_menu_items', 'g_search_right_nav', 10, 2 );
function g_search_right_nav( $menu, stdClass $args ){
if ( 'secondary' != $args->theme_location )
[post_date] and [post_edit]
[post_date] by [post_author_posts_link] [post_comments] [post_edit]