Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?

You are adding filter, not an action. I don’t know how Genesis hook works, but native wp_nav_menu_items passes (and expects back) markup of custom menu items. Instead of echoing your additional stuff you should append it to input and return. This is clearly how it’s done in tutorial you linked to: add_filter(‘wp_nav_menu_items’,’follow_icons’,10,1); function follow_icons($output) { … Read more

Modify the post/entry wrapper markup in genesis childtheme [closed]

Today I had a similar issue and this worked for me: /** * Add and extra class to the entry-content div * */ function vdl_entry_content_extraclass( $attributes ) { $attributes[‘class’] = $attributes[‘class’]. ‘ my-custom-class’; return $attributes; } add_filter( ‘genesis_attr_entry-content’, ‘vdl_entry_content_extraclass’ ); In my case, I am adding this code to my single-portfolio.php template because I only … Read more

How to add code just below opening body tag in Genesis framework

Did you even open header.php and take a peek? You’ll see genesis_before() called right after the opening <body> tag – follow the white rabbit and you get: function genesis_before() { do_action(‘genesis_before’); } And likewise for the footer. So… add_action( ‘genesis_before’, ‘im_a_lazy_copy_paster’ ); add_action( ‘genesis_after’, ‘im_a_lazy_copy_paster’ ); function im_a_lazy_copy_paster() { if ( current_filter() == ‘genesis_before’ ) … Read more

Any advantage of using wp_scripts and is_IE when enqueuing scripts

To extend on @gmazzap suggestion on not using globals when you can use wp_scripts(), there is a shortcut for wp_scripts() for adding conditional comments called wp_script_add_data and likewise wp_style_add_data for conditional styles. So the correct way to use conditionals as of WordPress 4.2 is like this: /** * IE enqueue HTML5shiv with conditionals * @link … Read more

Undefined offset: 0 in > […] /wp-includes/capabilities.php on line 1067

You have found a bug in Genesis. Your Xdebug stack trace fingers the culprit as the genesis_save_custom_fields() function which calls current_user_can() with a singular capability (edit_post and edit_page) which also requires an additional argument, in this case the post ID which is missing. current_user_can() calls has_cap() which calls map_meta_cap() which does a switch statement on … Read more