Skip to content

Instantly share code, notes, and snippets.

Sridhar Katakam srikat

View GitHub Profile
@srikat
srikat / Media Queries
Created May 9, 2013
Taken from Skype.
View Media Queries
@media only screen and (min-width: 0px) and (max-width: 320px) {
}
/* Smartphones (portrait and landscape) ----------- */
@srikat
srikat / functions.php
Created May 14, 2013
Adding a search box in nav bar in WooThemes Canvas
View functions.php
<?php
add_action( 'woo_nav_inside', 'woo_add_nav_search', 30 );
if ( ! function_exists( 'woo_add_nav_search' ) ) {
function woo_add_nav_search () { ?>
<div class="fr">
<?php get_search_form(); ?>
</div>
@srikat
srikat / functions.php
Created May 15, 2013
Change URL of logo in Canvas from the default (site homepage) to a custom one. Code is to be added in child theme's functions.php.
View functions.php
<?php
// Remove logo code from Canvas
add_action('wp_head', 'remove_woo_logo');
function remove_woo_logo() {
remove_action('woo_header_inside','woo_logo');
}
/*-----------------------------------------------------------------------------------*/
@srikat
srikat / 1. Step 1
Last active Jan 13, 2016
Mobile nav for custom menu in a HTML module in iThemes Builder
View 1. Step 1
Using BuilderChild-Air. Can be used in any child theme in conjunction with http://ithemes.com/codex/page/Plugin_related_and_other_generic_customizations_2#How_to_Create_Mobile_Navigation_like_the_new_Air_Theme
Code in PHP enabled HTML module (2nd module from top in layout) where "All Pages" is the name of custom menu:
<a id="logo" href="<?php bloginfo('url'); ?>"><img src="<?php bloginfo( 'stylesheet_directory' ); ?>/images/100x50.gif" alt="Home" /></a>
<?php wp_nav_menu( array( 'menu' => 'All Pages', 'menu_class' => 'builder-module-navigation') ); ?>
@srikat
srikat / new_gist_file
Created Jul 27, 2013
To display YouTube video with player when the video URL has been entered in a custom field attached to a CPT in WordPress. Details: http://sridharkatakam.com/how-to-render-youtube-video-url-with-player-when-using-views
View new_gist_file
[pb_vidembed title="" caption="" url='[types field="youtube-link" class="youtube-video" raw="true"][/types]' type="yt" w="270" h="217"]
@srikat
srikat / functions.php
Created Aug 29, 2013
Adding date shortcodes before entry content for articles in Genesis using "genesis_before_entry_content" action. http://sridharkatakam.com/how-to-add-circular-date-for-posts-in-genesis/
View functions.php
add_action( 'genesis_before_entry_content','sri_add_date');
function sri_add_date () {
if (is_home() || is_archive()) { ?>
<div class="my-date">
<span class="my-date-day"><?php echo do_shortcode("[post_date format='j']"); ?></span>
<span class="my-date-month"><?php echo do_shortcode("[post_date format='M']"); ?></span>
</div>
<?php }
}
//* Customize the post info function
@srikat
srikat / google-translator-in-nav.php
Created Aug 31, 2013
Add this in functions.php to insert a div that shows the output of Google Language Translator WordPress plugin. Details: http://sridharkatakam.com/how-to-add-google-translator-in-primary-navigation-of-genesis/
View google-translator-in-nav.php
<?php
//* Do NOT include the opening php tag
add_filter( 'genesis_nav_items', 'sk_google_translator', 10, 2 );
add_filter( 'wp_nav_menu_items', 'sk_google_translator', 10, 2 );
function sk_google_translator($menu, $args) {
$args = (array)$args;
if ( 'primary' !== $args['theme_location'] )
return $menu;
@srikat
srikat / genesis-masonry.php
Last active Apr 9, 2019
Pinterest-like Masonry layout for Posts page and Archives in Genesis. Details: http://sridharkatakam.com/using-masonry-genesis-pinterest-like-layout/
View genesis-masonry.php
<?php
//* Do NOT include the opening php tag
// =================================================================
// = Pinterest-like Masonry layout for Posts page and Archives =
// =================================================================
//* Enqueue and initialize jQuery Masonry script
function sk_masonry_script() {
if (is_home() || is_archive()) {
@srikat
srikat / style.css
Last active Dec 23, 2015
CSS for Pinterest-like Masonry layout in Genesis. Details: http://sridharkatakam.com/using-masonry-genesis-pinterest-like-layout/
View style.css
/****************************************************************
Pinterest-like Masonry layout for Posts page and Archives
****************************************************************/
.masonry-page .content .entry {
padding: 0;
border-radius: 0;
width: 255px;
overflow: hidden;
}
@srikat
srikat / Blog Post with Date.html
Created Sep 26, 2013
Views plugins' Content Template code to display month and day for each post. Details: http://sridharkatakam.com/show-calendar-style-dates-recent-posts-list/
View Blog Post with Date.html
<article>
<header>
<h4><a title="[wpv-post-title]" href="[wpv-post-url]">[wpv-post-title]</a></h4>
<em class="date">
<time datetime="[wpv-post-date format="c"]" itemprop="datePublished">
<span class="month">[wpv-post-date format="M"]</span>
<span class="day">[wpv-post-date format="j"]</span>
</time>
</em>
</header>
You can’t perform that action at this time.