quiz

// setup console.log(“running”); let q = 1; const submit = document.getElementById(“next-button”); const question = document.getElementById(“question”); // next button document.getElementById(“next-button”).addEventListener(“click”, function () { // split by q value let radioButtons = document.querySelectorAll(“input[name=’yes-no’]”); if (q == 4) { radioButtons = document.querySelectorAll(“input[name=’time-choice’]”); }…Continue reading

Untitled Snippet

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); if (strpos($url,’product_search=’) !== false) { $attributes[‘index’] = “noindex”; }; return $attributes; }Continue reading

Allow ico Files Upload

/*——————————————— TYPE MIME ICO par HP MC&C ———————————————-*/ function allow_ico_mime_types( $mimes ){ $mimes[‘ico’] = ‘image/x-icon’; return $mimes; } add_filter( ‘upload_mimes’, ‘allow_ico_mime_types’ );Continue reading

MemberPress: Remove State Text Field

function mepr_remove_state_field() { global $post; $mepr_options = MeprOptions::fetch(); $is_product_page = ( false !== ( $prd = MeprProduct::is_product_page($post) ) ); if( $mepr_options->global_styles || $is_product_page ) { ?>Continue reading

Leave Tasty recipe ratings with WP-PostRatings

// Disable standard ratings UI add_filter( ‘tasty_recipes_enable_ratings’, ‘__return_false’ ); /**  * Filter template variables to render WP-PostRatings UI  * within the recipe card.  *  * @param array $template_vars Variables to be passed to the template.  * @param object $recipe  …Continue reading

Move Jump to Recipe above featured image in Genesis

/** * Ensures the “Jump to Recipe” button is added above the featured image. */ add_action( ‘init’, function(){ if ( method_exists( ‘Tasty_Recipes\Shortcodes’, ‘filter_the_content_late’ ) ) { remove_filter( ‘the_content’, array( ‘Tasty_Recipes\Shortcodes’, ‘filter_the_content_late’ ), 100 ); add_action( ‘genesis_before_entry_content’, function() { echo Tasty_Recipes\Shortcodes::filter_the_content_late(…Continue reading

Move Jump to Recipe above featured image

/** * Ensures the “Jump to Recipe” button is added to the content really late. */ add_action( ‘init’, function() { if ( method_exists( ‘Tasty_Recipes\Shortcodes’, ‘filter_the_content_late’ ) ) { remove_filter( ‘the_content’, array( ‘Tasty_Recipes\Shortcodes’, ‘filter_the_content_late’ ), 100 ); add_filter( ‘the_content’, array( ‘Tasty_Recipes\Shortcodes’,…Continue reading