StudioPress: add meta tag to every page [closed]

This function should take care for the input into the head of each page/post as asked. Please make a copy of functions.php before adding following code.Adjust to your own preferences if needed. /** * Add meta to head * * Read more {@link https://codex.wordpress.org/Plugin_API/Action_Reference/wp_head} * @version WordPress 4.8 */ function wpse272951_wsm_keep_ie_modern() { echo “<meta http-equiv=\”X-UA-Compatible\” … Read more

Editing or filtering the output of the Genesis navigation

You could try to use the wp_nav_menu_args filter (untested): /** * Add the Menu_With_Data_Attr walker to the wp_nav_menu() used by genesis_do_nav() */ add_filter( ‘wp_nav_menu_args’, function( $args ){ if( isset( $args[‘menu_class’] ) && ‘menu genesis-nav-menu menu-primary’ === $args[‘menu_class’] ) { if( class_exists( ‘Menu_With_Data_Attr’ ) ) { $args[‘walker’] = new Menu_With_Data_Attr(); } } return $args; }); to … Read more

Adding ads after a certain number of paragraphs within Genesis themework

I’ve found explode() to be useful when trying to break strings apart. This code creates an array of paragraph chunks, inserts the new block after two paragraphs and concatenates it back into a string for output. function insert_ad_block( $text ) { if ( is_single() ) : $ads_text=”<div class=”wpselect_middle_content”>My Ad Code Here</div>”; $split_by = “\n”; $insert_after … Read more

How to remove an action added by a child theme of Genesis

Thanks to Dan that commented with a useful post I found on Google but didn’t read with the required attention, the solution is this: function my_remove() { remove_action( ‘genesis_entry_header’, ‘shq_genestrap_post_meta_categories’, 9 ); } add_action(‘genesis_entry_header’, ‘my_remove’, 8); Using priority 9 in add_action() doesn’t work: I had to set a priority lower than the one used to … Read more

Uncaught TypeError: Cannot read property ‘replace’ of undefined

In WordPress jQuery is loaded in noConflict mode, it means that you need to use jQuery instead of the dollar sign $ You could wrap the code in an anonymous function (technically any IIFE) where you pass in jQuery to be mapped to $ and combine this with document ready, like this: jQuery(document).ready(function($) { // … Read more

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