From 095651c4bf2ba5c3e0670ca0ffcbbf2b770a5c73 Mon Sep 17 00:00:00 2001 From: Haley Date: Thu, 23 Jan 2025 12:07:51 -0800 Subject: [PATCH] heading and cta styles --- .../acf-json/group_625dc5c18c6d5.json | 5 +- .../themes/medicalalert/functions.php | 109 +++++++++++------- 2 files changed, 71 insertions(+), 43 deletions(-) diff --git a/wp/wp-content/themes/medicalalert/acf-json/group_625dc5c18c6d5.json b/wp/wp-content/themes/medicalalert/acf-json/group_625dc5c18c6d5.json index 60852266..b45e7eaa 100644 --- a/wp/wp-content/themes/medicalalert/acf-json/group_625dc5c18c6d5.json +++ b/wp/wp-content/themes/medicalalert/acf-json/group_625dc5c18c6d5.json @@ -2382,7 +2382,7 @@ "name": "copy", "aria-label": "", "type": "wysiwyg", - "instructions": "To add button style for a link add class=\"button--primary\" to anchor tag.", + "instructions": "To add button style for a link add class=\"button--primary\" to anchor tag.\r\nOr, after creating the link, highlight it and choose from the Formats section.\r\nTo add different heading styles add class=\"h1\" class=\"h2\" etc...", "required": 0, "conditional_logic": 0, "wrapper": { @@ -2391,6 +2391,7 @@ "id": "" }, "default_value": "", + "allow_in_bindings": 1, "tabs": "all", "toolbar": "full", "media_upload": 1, @@ -8574,5 +8575,5 @@ "active": true, "description": "", "show_in_rest": 0, - "modified": 1736974944 + "modified": 1737662796 } diff --git a/wp/wp-content/themes/medicalalert/functions.php b/wp/wp-content/themes/medicalalert/functions.php index 05519fcf..c4ecef5c 100644 --- a/wp/wp-content/themes/medicalalert/functions.php +++ b/wp/wp-content/themes/medicalalert/functions.php @@ -217,7 +217,8 @@ function populate_SESSpromotion_description($value) { * @author Golden Oak Web Design * @license https://www.gnu.org/licenses/gpl-2.0.html GPLv2+ */ -function blog_generate_rewrite_rules( $wp_rewrite ) { +function blog_generate_rewrite_rules($wp_rewrite) +{ $new_rules = array( '(([^/]+/)*blog)/page/?([0-9]{1,})/?$' => 'index.php?pagename=$matches[1]&paged=$matches[3]', 'blog/([^/]+)/?$' => 'index.php?post_type=post&name=$matches[1]', @@ -245,57 +246,83 @@ function blog_generate_rewrite_rules( $wp_rewrite ) { 'blog/[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$' => 'index.php?post_type=post&attachment=$matches[1]&cpage=$matches[2]', ); $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; - } +} - add_action( 'generate_rewrite_rules', 'blog_generate_rewrite_rules' ); +add_action('generate_rewrite_rules', 'blog_generate_rewrite_rules'); - function update_post_link( $post_link, $id = 0 ) { - $post = get_post( $id ); - if( is_object( $post ) && $post->post_type == 'post' ) { - return home_url( '/blog/' . $post->post_name . '/'); +function update_post_link($post_link, $id = 0) +{ + $post = get_post($id); + if (is_object($post) && $post->post_type == 'post') { + return home_url('/blog/' . $post->post_name . '/'); } return $post_link; - } - add_filter( 'post_link', 'update_post_link', 1, 3 ); +} - function skip_redirect( $skip_redirect, $post_id, $post ) { - if ( $post->post_type === 'post' ) { - $skip_redirect = true; - } +add_filter('post_link', 'update_post_link', 1, 3); - return $skip_redirect; - } - - add_filter( 'wpseo_premium_post_redirect_slug_change', 'skip_redirect', 10, 3 ); +function skip_redirect($skip_redirect, $post_id, $post) +{ + if ($post->post_type === 'post') { + $skip_redirect = true; + } + return $skip_redirect; +} + +add_filter('wpseo_premium_post_redirect_slug_change', 'skip_redirect', 10, 3); // Google Tag Manager -add_action( 'wp_head', 'gtm_output', 2 ); -add_action( 'wp_footer', 'gtm_datalayer_init', 10 ); -add_action( 'body_top', 'gtm_noscript_output' ); +add_action('wp_head', 'gtm_output', 2); +add_action('wp_footer', 'gtm_datalayer_init', 10); +add_action('body_top', 'gtm_noscript_output'); -function gtm_output() { ?> - - - - - + + - - - - - + + - - - 'CTA Primary', + 'selector' => 'a', + 'classes' => ['button--primary'], + ], + [ + 'title' => 'CTA Secondary', + 'selector' => 'a', + 'classes' => ['btn', 'btn-secondary'], + ], + [ + 'title' => 'CTA Tertiary', + 'selector' => 'a', + 'classes' => ['btn', 'btn-outline-primary'], + ], + ]); + // die(var_dump($init_array)); + return $init_array; +});