Skip to content

Instantly share code, notes, and snippets.

@idavinder
idavinder / style.css
Created September 12, 2017 14:03
Hide arrow next to menu item with sub-menu items in Astra theme
/* Hide arrow next to menu item with sub-menu items in Astra theme - BasicWP.com */
.main-header-bar .menu-item-has-children>a:after,
.main-header-bar .page_item_has_children>a:after {
content: none;
}
@idavinder
idavinder / Customize Post Info in Genesis theme
Created June 5, 2016 07:49
Customize Post Info in Genesis theme
//* Customize post info in Genesis
add_filter( 'genesis_post_info', 'bw_post_info_filter' );
function bw_post_info_filter($post_info) {
if ( !is_page() ) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}}
@idavinder
idavinder / Remove Categories from Post Meta in WordPress
Created August 23, 2015 14:40
Remove Categories from Post Meta in WordPress
//* Remove categories from post meta - shared on basicwp.com
function the_category_filter($thelist,$separator=' ') {
if(!defined('WP_ADMIN')) {
//list the category names to exclude
$exclude = array('Featured', 'Category #1');
$cats = explode($separator,$thelist);
$newlist = array();
foreach($cats as $cat) {
$catname = trim(strip_tags($cat));
if(!in_array($catname,$exclude))
@idavinder
idavinder / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@idavinder
idavinder / Exclude Categories from Category Dropdown Widget in WordPress
Last active August 29, 2015 14:22
Exclude Categories from Category Dropdown Widget in WordPress
//* Exclude Categories from Category Widget - http://www.basicwp.com/exclude-categories-from-category-widgets-in-wordpress/
function custom_category_widget($args) {
$exclude = "3,4"; // Category IDs to be excluded
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_dropdown_args","custom_category_widget");
@idavinder
idavinder / Exclude Categories from Category Widget in WordPress
Created June 3, 2015 11:34
Exclude Categories from Category Widget in WordPress
//* Exclude Categories from Category Widget - basicWP.com
function custom_category_widget($args) {
$exclude = "3,4"; // Category IDs to be excluded
$args["exclude"] = $exclude;
return $args;
}
add_filter("widget_categories_args","custom_category_widget");
@idavinder
idavinder / Add multiple Google Fonts to Genesis Theme
Created May 25, 2015 07:42
Add multiple Google Fonts to Genesis Theme
//* Add multiple Google Fonts in Genesis - http://www.basicwp.com/?p=2054
add_action( 'wp_enqueue_scripts', 'genesis_ig_multiple_google_fonts' );
function genesis_ig_multiple_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato|Open+Sans|Oswald:400,300,700', array(), CHILD_THEME_VERSION );
}
@idavinder
idavinder / Add Google Font in Genesis Theme
Created May 25, 2015 07:36
Add Google Font in Genesis Theme
//* Add Google Font in Genesis - http://www.basicwp.com/?p=2054
add_action( 'wp_enqueue_scripts', 'genesis_ig_google_fonts' );
function genesis_ig_google_fonts() {
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato', array(), CHILD_THEME_VERSION );
}
@idavinder
idavinder / Remove Filed Under & Tagged With in Genesis
Created May 25, 2015 07:08
Remove Filed Under & Tagged With in Genesis
//* Customize Entry Meta Filed Under and Tagged Under - http://www.basicwp.com/?p=268
add_filter( 'genesis_post_meta', 'ig_entry_meta_footer' );
function ig_entry_meta_footer( $post_meta ) {
$post_meta = '[post_categories before=""] [post_tags before=""]';
return $post_meta;
}
@idavinder
idavinder / Customize Filed Under & Tagged With in Genesis
Created May 25, 2015 07:04
Customize Filed Under & Tagged With in Genesis
//* Customize Entry Meta Filed Under and Tagged Under - http://www.basicwp.com/?p=268
add_filter( 'genesis_post_meta', 'ig_entry_meta_footer' );
function ig_entry_meta_footer( $post_meta ) {
$post_meta = '[post_categories before="Categories: "] [post_tags before="Tags: "]';
return $post_meta;
}