Skip to content

Instantly share code, notes, and snippets.

View vajrasar's full-sized avatar

Vajrasar Goswami vajrasar

View GitHub Profile
@vajrasar
vajrasar / time-ago.php
Last active August 29, 2015 14:06
time ago functionality
<?php
function vg_time_ago() {
global $post;
$date = get_post_time('G', true, $post);
/**
'G' stands for Hour, 24-hour, without leading zeros
@vajrasar
vajrasar / admin_bar.php
Last active August 29, 2015 14:06
Removing Items from admin bar
<?php // do not include this php tag
//* Remove links/menus from the admin bar
add_action( 'wp_before_admin_bar_render', 'vg_custom_admin_bar' );
function vg_custom_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('wp-logo');
@vajrasar
vajrasar / admin_bar1.php
Created September 19, 2014 15:21
Adding Items on Admin Bar - 1
<?php // do not include this php tag
//* Add items on the admin bar
add_action( 'wp_before_admin_bar_render', 'vg_custom_admin_bar' );
function vg_custom_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
@vajrasar
vajrasar / admin_bar2.php
Created September 19, 2014 15:38
Adding item on Admin Bar - 2
<?php // do not include this php tag
//* Add items on the admin bar
add_action( 'wp_before_admin_bar_render', 'vg_custom_admin_bar' );
function vg_custom_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
@vajrasar
vajrasar / add_admin3.php
Created September 19, 2014 15:46
Adding Item on Admin Bar - 3
<?php // do not add this php tag
//* Add items on the admin bar
add_action( 'wp_before_admin_bar_render', 'vg_custom_admin_bar' );
function vg_custom_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
@vajrasar
vajrasar / admin_bar4.php
Created September 19, 2014 15:53
Adding items on Admin Bar - 4
<?php // do not add this php tag
//* Add items on the admin bar
add_action( 'wp_before_admin_bar_render', 'vg_custom_admin_bar' );
function vg_custom_admin_bar() {
global $wp_admin_bar;
$wp_admin_bar->add_menu( array(
@vajrasar
vajrasar / right.php
Created October 17, 2014 12:14
header-right
<?php
/******
Header Right Logic for CPTs
************************************************ */
genesis_register_sidebar( array(
'before_widget' => '<aside class="widget-area header-widget-area">',
'id' => 'header-right-offers',
@vajrasar
vajrasar / enviratitle.php
Last active August 29, 2015 14:17
[Envira Gallery] Title with Link to Image (LightBox) - Problem
<?php
/*
This was working fine, I was able to show Title of image with a hyperlink to image lightbox.
But suddenly from past a week site was down, when I checked error logs it stated
that the code (which was in my functions.php) is throwing error - PHP Parse error: syntax error, unexpected '['
That error was in Line 24 of this code.
*/
@vajrasar
vajrasar / func.php
Last active August 29, 2015 14:20
For Tut: Adding Inline logo via Theme Options in Genesis
<?php
//* Add the theme-opt.php file
require_once('theme-opt.php');
/**********************************
*
* Replace Header Site Title with Inline Logo
*
* Fixes Genesis bug - when using static front page and blog page (admin reading settings) Home page is <p> tag and Blog page is <h1> tag
@vajrasar
vajrasar / tooltip_css.css
Last active August 29, 2015 14:20
To show excerpt in tooltip while user hovers on title
.hide-excerpt {
display: none;
}
#powerTip {
max-width: 300px;
white-space: normal !important;
}