Using Custom Templates for Custom Post Types for the Genesis Theme Framework?

Turns out I was wrong, Genesis does support using the page_posttype.php method of creating a custom template. It turned out to be very simple. Here’s the contents of my page_members.php file (located in the child theme folder): <?php /* Template Name: Members */ remove_action(‘genesis_loop’, ‘genesis_do_loop’); add_action(‘genesis_loop’, ‘custom_loop’); function custom_loop() { global $paged; $args = array(‘post_type’ … Read more

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

Genesis – Customize search form

I’m not sure why you’re getting a 500 error. Likely because you’re trying to use a function before it’s been defined. But I think you’re going about the problem the wrong way. Genesis does provide a filter before returning the search form. Why not just add a filter to the genesis_search_form hook? You can add … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)